Cell returns the drawable for the current frame.
()
| 71 | |
| 72 | // Cell returns the drawable for the current frame. |
| 73 | func (ac *AnimationComponent) Cell() Drawable { |
| 74 | if len(ac.CurrentAnimation.Frames) == 0 { |
| 75 | log.Println("No frame data for this animation. Selecting zeroth drawable. If this is incorrect, add an action to the animation.") |
| 76 | return ac.Drawables[0] |
| 77 | } |
| 78 | idx := ac.CurrentAnimation.Frames[ac.index] |
| 79 | ac.CurrentFrame = idx |
| 80 | return ac.Drawables[idx] |
| 81 | } |
| 82 | |
| 83 | // NextFrame advances the current animation by one frame. |
| 84 | func (ac *AnimationComponent) NextFrame() { |
no outgoing calls