Code examples for the C and C++ APIs and for Flecs Script. Each page shows the example in every language it is available in. The sources live in the examples folder of the repository.
Entities
Game mechanics
Modules
Observers
Prefabs
Queries
- Basics (C, C++)
- Change tracking (C, C++)
- Component inheritance (C, C++)
- Cyclic variables (C, C++)
- Each callback (C++)
- Each w entity callback (C++)
- Each w iter callback (C++)
- Facts (C, C++)
- Find entity (C++)
- Group by (C, C++)
- Group by callbacks (C, C++)
- Group by custom (C, C++)
- Group iter (C, C++)
- Group iter all (C, C++)
- Hierarchies (C)
- Hierarchy (C++)
- Iter info (C++)
- Iter targets (C, C++)
- Run callback (C++)
- Setting variables (C, C++)
- Singleton (C, C++)
- Sorting (C, C++)
- Transitive queries (C, C++)
- Variables (C, C++)
- Wildcards (C, C++)
- With (C++)
- Without (C++)
- World query (C++)
Reflection
- Auto define enum (C, C++)
- Auto define nested struct (C, C++)
- Auto define struct (C, C++)
- Basics (C, C++)
- Basics bitmask (C, C++)
- Basics deserialize (C, C++)
- Basics enum (C, C++)
- Basics json (C, C++)
- Custom serializer (C, C++)
- Entity type (C, C++)
- Member ranges (C, C++)
- Nested set member (C, C++)
- Nested struct (C, C++)
- Portable type (C++)
- Query to custom json (C, C++)
- Query to json (C, C++)
- Runtime component (C, C++)
- Runtime nested component (C, C++)
- Ser opaque string (C)
- Ser opaque type (C, C++)
- Ser opaque vector (C)
- Ser std optional (C++)
- Ser std string (C++)
- Ser std vector (C++)
- Units (C, C++)
- World ser deser (C, C++)
Relationships
Script
Systems
- Basics (C, C++)
- Custom phases (C, C++)
- Custom phases no builtin (C, C++)
- Custom pipeline (C, C++)
- Delta time (C, C++)
- Each callback (C++)
- Each w entity callback (C++)
- Each w iter callback (C++)
- Immediate (C, C++)
- Multiple queries (C++)
- Mutate entity (C, C++)
- Mutate entity handle (C++)
- Pipeline (C, C++)
- Run callback (C, C++)
- Run to each callback (C++)
- Startup system (C, C++)
- Sync point (C, C++)
- Sync point delete (C, C++)
- System ctx (C, C++)
- Target fps (C, C++)
- Time interval (C, C++)