New collab with Chris on subtitle :)
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/v2/text"
|
||||
)
|
||||
|
||||
const (
|
||||
splashText = "schmoopysoft"
|
||||
)
|
||||
|
||||
type Splash struct {
|
||||
Dimensions groovy.Area
|
||||
bgcolor color.RGBA
|
||||
@@ -26,15 +30,18 @@ func NewSplash() Splash {
|
||||
func (s *Splash) Update() error {
|
||||
s.increment++
|
||||
|
||||
s.bgcolor.R = (s.bgcolor.R - 2) % 0xFF
|
||||
s.bgcolor.G = (s.bgcolor.G - 2) % 0xFF
|
||||
s.bgcolor.B = (s.bgcolor.B - 2) % 0xFF
|
||||
s.bgcolor.R = (s.bgcolor.R - 1) % 0xFF
|
||||
s.bgcolor.G = (s.bgcolor.G - 1) % 0xFF
|
||||
s.bgcolor.B = (s.bgcolor.B - 1) % 0xFF
|
||||
|
||||
if s.bgcolor.R == 0x00 {
|
||||
s.events[groovy.COMPLETED]()
|
||||
|
||||
//scene cleanup (for next time)
|
||||
s.increment = 0
|
||||
s.bgcolor.R = 0xFF
|
||||
s.bgcolor.G = 0xFF
|
||||
s.bgcolor.B = 0xFF
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -42,7 +49,11 @@ func (s *Splash) Update() error {
|
||||
|
||||
func (s *Splash) Draw(screen *ebiten.Image) {
|
||||
screen.Fill(s.bgcolor)
|
||||
text.Draw(screen, "splash", splashmenu.SplashFont.Splash, 40, 40, color.White)
|
||||
x := s.Dimensions.Width/2 - 400
|
||||
y := s.Dimensions.Height / 2
|
||||
text.Draw(screen, splashText, splashmenu.SplashFont.MegaTitle, x, y, color.White)
|
||||
|
||||
text.Draw(screen, "\"how was the gravy\"\n- christorpher hollick", splashmenu.SplashFont.Title, x, y+40, color.White)
|
||||
}
|
||||
|
||||
func (s *Splash) SetEventHandler(event groovy.SceneEvent, f func()) {
|
||||
|
||||
Reference in New Issue
Block a user