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

20 lines
242 B
Go
Raw Normal View History

Make animations work in the options screen
2020-03-23 00:33:29 +00:00
package ui
import (
"github.com/hajimehoshi/ebiten"
)
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: 42ms Template: 4ms
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