Prefabs are prefabricated game entities intended for simple and one-time-use of a component. Thus, there is one prefab for each class-type component. There is also, currently, one other experimental prefab for gestures.
Note that most prefabs do not implement gestures as that is generally beyond the intended purpose of prefabs. If nothing else, it would lead to too many prefab variants. It is possible to extend a prefab with gesture mixins but this is not considered best practice versus extending GameEntity... but not really considered bad practice either. It's a style choice.
Built-in prefabs |
---|
SpritePrefab AnimationPrefab MessageBoxPrefab NinePatchPrefab ParallaxPrefab ParticlePrefab TapAreaPrefab TextPrefab TimerPrefab |
Implements SpriteComponent.
Implements AnimationComponent.
Adds destroyOnFinish
constructor parameter and property.
Implements MessageBoxComponent.
Adds destroyOnFinish
constructor parameter and property.
Implements NinePatchComponent.
Implements ParallaxComponent.
Implements ParticleComponent.
Currently has a progress
property... but can't promise what it might have after a needed refactor.
Implements the GestureArea mixin and the TapDetector mixin and no visual components. Experimental.
This is intended for use only with overly-simple GUI objects that have more than one hot spot. For example, a yes/no message box with static, pre-drawn buttons. If, instead, you have a separate button object, that button should be its own GameEntity with gesture mixins, plus a visual component (such as an AnimationComponent, for example).
Implements TextComponent.
Implements TimerComponent.
TODO: Adds destroyOnFinish
constructor parameter and property.