Crafty.e()

Events

NewEntity [Data = { id:Number }]
When the entity is created and all components are added
public Entity Crafty.e(String componentList)
componentList

List of components to assign to new entity

public Entity Crafty.e(String component1[, .., String componentN])
component#

Component to add

Creates an entity. Any arguments will be applied in the same way .addComponent() is applied as a quick way to add components.

Any component added will augment the functionality of the created entity by assigning the properties and methods from the component to the entity.

Example

var myEntity = Crafty.e("2D, DOM, Color");

See Also