mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
examples: Add comments
This commit is contained in:
parent
f325a70da2
commit
4f3682a130
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user