Logo
Explore Help
Sign In
lupine/ordoor
1
0
Fork 0
You've already forked ordoor
Code Issues Pull Requests Releases Wiki Activity
Files
main
ordoor/internal/ui/animation.go

20 lines
245 B
Go
Raw Permalink Normal View History

Make animations work in the options screen
2020-03-23 00:33:29 +00:00
package ui
import (
UNTESTED: ebiten v2
2020-11-21 19:27:09 +00:00
"github.com/hajimehoshi/ebiten/v2"
Make animations work in the options screen
2020-03-23 00:33:29 +00:00
)
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
var (
SpeedDivisor = 2
)
Make animations work in the options screen
2020-03-23 00:33:29 +00:00
type animation []*ebiten.Image
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
func (a animation) image(tick int) *ebiten.Image {
Make animations work in the options screen
2020-03-23 00:33:29 +00:00
if len(a) == 0 {
return nil
}
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
return a[(tick/SpeedDivisor)%len(a)]
Make animations work in the options screen
2020-03-23 00:33:29 +00:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 66ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API