Skip to content

Commit 409f0ca

Browse files
committed
example: update size
1 parent 126e705 commit 409f0ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

example/ui.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (g *Game) writeLog(text string) {
2626
func (g *Game) testWindow(ctx *debugui.Context) {
2727
ctx.Window("Demo Window", image.Rect(40, 40, 340, 500), func(layout debugui.ContainerLayout) {
2828
ctx.Header("Window Info", false, func() {
29-
ctx.SetGridLayout([]int{60, -1}, nil)
29+
ctx.SetGridLayout([]int{-1, -1}, nil)
3030
ctx.Text("Position:")
3131
ctx.Text(fmt.Sprintf("%d, %d", layout.Bounds.Min.X, layout.Bounds.Min.Y))
3232
ctx.Text("Size:")
@@ -43,7 +43,7 @@ func (g *Game) testWindow(ctx *debugui.Context) {
4343
}
4444
})
4545
ctx.Header("Test Buttons", true, func() {
46-
ctx.SetGridLayout([]int{100, -1, -1}, nil)
46+
ctx.SetGridLayout([]int{-2, -1, -1}, nil)
4747
ctx.Text("Test buttons 1:")
4848
if ctx.Button("Button 1") {
4949
g.writeLog("Pressed button 1")
@@ -67,7 +67,7 @@ func (g *Game) testWindow(ctx *debugui.Context) {
6767
})
6868
})
6969
ctx.Header("Tree and Text", true, func() {
70-
ctx.SetGridLayout([]int{140, -1}, nil)
70+
ctx.SetGridLayout([]int{-1, -1}, nil)
7171
ctx.GridCell(func() {
7272
ctx.TreeNode("Test 1", func() {
7373
ctx.TreeNode("Test 1a", func() {
@@ -84,7 +84,7 @@ func (g *Game) testWindow(ctx *debugui.Context) {
8484
})
8585
})
8686
ctx.TreeNode("Test 2", func() {
87-
ctx.SetGridLayout([]int{54, 54}, nil)
87+
ctx.SetGridLayout([]int{-1, -1}, nil)
8888
if ctx.Button("Button 3") {
8989
g.writeLog("Pressed button 3")
9090
}
@@ -110,9 +110,9 @@ func (g *Game) testWindow(ctx *debugui.Context) {
110110
"ipsum, eu varius magna felis a nulla.")
111111
})
112112
ctx.Header("Color", true, func() {
113-
ctx.SetGridLayout([]int{-1, 78}, []int{74})
113+
ctx.SetGridLayout([]int{-3, -1}, []int{74})
114114
ctx.GridCell(func() {
115-
ctx.SetGridLayout([]int{46, -1}, nil)
115+
ctx.SetGridLayout([]int{-1, -3}, nil)
116116
ctx.Text("Red:")
117117
ctx.Slider(&g.bg[0], 0, 255, 1, 0)
118118
ctx.Text("Green:")
@@ -163,7 +163,7 @@ func (g *Game) logWindow(ctx *debugui.Context) {
163163
})
164164
ctx.GridCell(func() {
165165
var submit bool
166-
ctx.SetGridLayout([]int{-1, 70}, nil)
166+
ctx.SetGridLayout([]int{-3, -1}, nil)
167167
if ctx.TextField(&g.logSubmitBuf) {
168168
if g.logSubmitBuf != "" && ebiten.IsKeyPressed(ebiten.KeyEnter) {
169169
submit = true

0 commit comments

Comments
 (0)