diff --git a/examples/font/main.go b/examples/font/main.go index df8a3c35b..7b1b878ce 100644 --- a/examples/font/main.go +++ b/examples/font/main.go @@ -128,6 +128,7 @@ func init() { } func update(screen *ebiten.Image) error { + // Change the text color for each second. if counter%ebiten.FPS == 0 { kanjiText = []rune{} for j := 0; j < 4; j++ { @@ -148,10 +149,16 @@ func update(screen *ebiten.Image) error { return nil } - msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS()) const x = 20 + + // Draw info + msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS()) text.Draw(screen, msg, mplusNormalFont, x, 40, color.White) + + // Draw the sample text text.Draw(screen, sampleText, mplusNormalFont, x, 80, color.White) + + // Draw Kanji text lines for i, line := range strings.Split(string(kanjiText), "\n") { text.Draw(screen, line, mplusBigFont, x, 160+54*i, kanjiTextColor) } diff --git a/examples/gamepad/main.go b/examples/gamepad/main.go index 3dd04ffda..839d55c42 100644 --- a/examples/gamepad/main.go +++ b/examples/gamepad/main.go @@ -54,6 +54,7 @@ func update(screen *ebiten.Image) error { return nil } + // Draw the current gamepad status. str := "" if len(ids) > 0 { for _, id := range ids {