-
Notifications
You must be signed in to change notification settings - Fork 6
Entities
Mark Knol edited this page Jan 17, 2018
·
4 revisions
You can nest Entities inside an Entity (addChild-function) but you can also add Components (using the add-function). You cannot extend a Entity. The Entities define the hierarchy and order of the 'displaylist'/rendering order.
In Flambe, every entity has these important functions:
-
addChild(entity:Entity)
Adds a child Entity (to nest entities) -
removeChild(entity:Entity)
Remove a child Entity -
add(component:Component)
Add a component to this entity. Any previous component of this type will be replaced. -
remove(component:Component)
Remove a component from this entity. -
get(componentClass:Class)
Gets a component of a given type from this entity. -
getComponent(name:String)
Gets a component by name from this entity. -
has(componentClass:Class)
Checks if this entity has a component of the given type. -
disposeChildren()
Dispose all of this entity's children, without touching its own components or removing itself from its parent. -
dispose()
Removes this entity from its parent, and disposes all its components and children.
Documentation guide for Flambe - Targeted to version 4.0+
Flambe | Installation | Demo projects | Showcase | API Reference | Forum
Flambe is MIT licensed and available for free. Feel free to contribute!
- Home / Installation
- Entity / Components
- Core
- Assets
- Publish your game
- Other
- Editors
- Plugins, tools, extensions
- Help
- More Flambe