Host typegenerated
Animation
Playing an object's animations, such as walk or jump, set up for it in the scene.
8 members · engine 0.1.0
Animation.clip(entity: Entity) -> StringThe name of the animation an object is playing.Animation.fired(entity: Entity, event: String) -> boolWhether an object's animation reached a moment named in it, such as"step"as a foot lands or"strike"as a blade hits, since the last frame. True for that one frame.Animation.frame(entity: Entity) -> numberWhich picture of its animation an object is showing, counting from the start of the animation.Animation.is_finished(entity: Entity) -> boolWhether an animation that plays once, such as an attack, has finished.Animation.play(entity: Entity, clip: String) -> unitPlays one of an object's animations by name, such as"walk". Calling it again with the animation already playing does nothing, so it is safe to call every frame.Animation.restart(entity: Entity) -> unitStarts an object's current animation again from the beginning.Animation.set_speed(entity: Entity, speed: number) -> unitHow fast an object's animations play: 1 is normal speed, 2 is twice as fast.Animation.stop(entity: Entity) -> unitStops an object's animation.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b