Files
ordoor/internal/ui/animation.go

16 lines
200 B
Go
Raw Normal View History

package ui
import (
"github.com/hajimehoshi/ebiten"
)
type animation []*ebiten.Image
func (a animation) image(step int) *ebiten.Image {
if len(a) == 0 {
return nil
}
return a[step%len(a)]
}