MCPcopy Index your code
hub / github.com/EngoEngine/engo / AnimationComponent

Struct AnimationComponent

common/animation.go:18–27  ·  view source on GitHub ↗

AnimationComponent tracks animations of an entity it is part of. This component should be created using NewAnimationComponent.

Source from the content-addressed store, hash-verified

16// AnimationComponent tracks animations of an entity it is part of.
17// This component should be created using NewAnimationComponent.
18type 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected