add Anim method

This commit is contained in:
Josh Deprez 2021-10-01 13:46:33 +10:00
parent 3cb6f496ea
commit 4a39c55f2a

View file

@ -48,6 +48,9 @@ func (s *Sprite) Scan(visit VisitFunc) error {
return visit(&s.Sheet) return visit(&s.Sheet)
} }
// Anim returns the current Anim.
func (s *Sprite) Anim() *Anim { return s.anim }
// SetAnim sets the Anim to use for the sprite. If it is not the same as the // SetAnim sets the Anim to use for the sprite. If it is not the same as the
// one currently set, it resets the new anim. // one currently set, it resets the new anim.
func (s *Sprite) SetAnim(a *Anim) { func (s *Sprite) SetAnim(a *Anim) {