From 8341fa993364532d8d8a268dcb6614d9d08ae714 Mon Sep 17 00:00:00 2001 From: dbenavid Date: Tue, 5 Sep 2023 07:53:12 -0400 Subject: [PATCH] New collab with Chris on subtitle :) --- examples/splashmenu/scenes/splash.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/splashmenu/scenes/splash.go b/examples/splashmenu/scenes/splash.go index 1933098..787bb45 100644 --- a/examples/splashmenu/scenes/splash.go +++ b/examples/splashmenu/scenes/splash.go @@ -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()) {