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

Method NextFrame

common/animation.go:84–100  ·  view source on GitHub ↗

NextFrame advances the current animation by one frame.

()

Source from the content-addressed store, hash-verified

82
83// NextFrame advances the current animation by one frame.
84func (ac *AnimationComponent) NextFrame() {
85 if len(ac.CurrentAnimation.Frames) == 0 {
86 log.Println("No frame data for this animation")
87 return
88 }
89
90 ac.index++
91 ac.change = 0
92 if ac.index >= len(ac.CurrentAnimation.Frames) {
93 ac.index = 0
94
95 if !ac.CurrentAnimation.Loop {
96 ac.CurrentAnimation = nil
97 return
98 }
99 }
100}
101
102// AnimationSystem tracks AnimationComponents, advancing their current animation.
103type AnimationSystem struct {

Callers 3

UpdateMethod · 0.80

Calls

no outgoing calls