Skip to content

Commit 76e0147

Browse files
authored
fixed a typo and made loopcount a const
1 parent 6d80aaf commit 76e0147

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ import (
2020
"github.com/hajimehoshi/ebiten/v2"
2121
)
2222

23+
const loopCount = 10
24+
2325
type Game struct {
2426
debugui debugui.DebugUI // Place a debugui instance on your Game
2527
}
2628

2729
func (g *Game) Update() error {
2830
if _, err := g.debugui.Update(func(ctx *debugui.Context) error {
29-
ctx.Window("Debugui Window", image.Rect(0, 0, 640, 400), func(layout debugui.ContainerLayout) {
31+
ctx.Window("Debugui Window", image.Rect(0, 0, 320, 240), func(layout debugui.ContainerLayout) {
3032
// Place all your widgets inside a ctx.Window
3133
ctx.Text("Some text")
3234

33-
// If you ever need to make loop to make widgets, use ctx.Loop
34-
loopCount := 10
35+
// If you ever need to make a loop to make widgets, use ctx.Loop
36+
3537
ctx.Loop(loopCount, func(index int) {
3638
ctx.Text(fmt.Sprintf("Index value is %d", index))
3739
})

0 commit comments

Comments
 (0)