AnimationComponent tracks animations of an entity it is part of. This component should be created using NewAnimationComponent.
| 16 | // AnimationComponent tracks animations of an entity it is part of. |
| 17 | // This component should be created using NewAnimationComponent. |
| 18 | type AnimationComponent struct { |
| 19 | Drawables []Drawable // Renderables |
| 20 | Animations map[string]*Animation // All possible animations |
| 21 | CurrentAnimation *Animation // The current animation |
| 22 | CurrentFrame int // The current animation frame number |
| 23 | Rate float32 // How often frames should increment, in seconds. |
| 24 | index int // What frame in the is being used |
| 25 | change float32 // The time since the last incrementation |
| 26 | def *Animation // The default animation to play when nothing else is playing |
| 27 | } |
| 28 | |
| 29 | // NewAnimationComponent creates an AnimationComponent containing all given |
| 30 | // drawables. Animations will be played using the given rate. |
nothing calls this directly
no outgoing calls
no test coverage detected