Files
ordoor/internal/ui/animation.go
Nick Thomas 69971b2825 Rework the UI framework
Interface is now Driver, and Widget is now a set of interfaces with a
struct per widget type. This should make it easier to add other types.
2020-03-24 20:21:55 +00:00

20 lines
242 B
Go

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