examples/flappy: adjust text layouts

This commit is contained in:
Hajime Hoshi 2023-11-16 23:03:32 +09:00
parent 3d1df32f43
commit 9fa60e1656

View File

@ -269,7 +269,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
switch g.mode { switch g.mode {
case ModeTitle: case ModeTitle:
titleTexts = "FLAPPY GOPHER" titleTexts = "FLAPPY GOPHER"
texts = "\n\n\n\n\n\n\nPRESS SPACE KEY\n\nOR A/B BUTTON\n\nOR TOUCH SCREEN" texts = "\n\n\n\n\n\nPRESS SPACE KEY\n\nOR A/B BUTTON\n\nOR TOUCH SCREEN"
case ModeGameOver: case ModeGameOver:
texts = "\nGAME OVER!" texts = "\nGAME OVER!"
} }
@ -298,7 +298,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
const msg = "Go Gopher by Renee French is\nlicenced under CC BY 3.0." const msg = "Go Gopher by Renee French is\nlicenced under CC BY 3.0."
op := &text.DrawOptions{} op := &text.DrawOptions{}
op.GeoM.Translate(screenWidth/2, screenHeight) op.GeoM.Translate(screenWidth/2, screenHeight-smallFontSize/2)
op.ColorScale.ScaleWithColor(color.White) op.ColorScale.ScaleWithColor(color.White)
op.LineHeight = smallFontSize op.LineHeight = smallFontSize
op.PrimaryAlign = text.AlignCenter op.PrimaryAlign = text.AlignCenter