Make animations work in the options screen
This commit is contained in:
15
internal/ui/animation.go
Normal file
15
internal/ui/animation.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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)]
|
||||
}
|
Reference in New Issue
Block a user