diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-02-02 14:12:51 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-02-02 14:12:51 +0500 |
| commit | e071f6670cf2d379237bf9cc66bd99696e48df8d (patch) | |
| tree | a5289ef8e991296c0807e61be92c3f76afd66ee0 /engine/main.go | |
| parent | 5f62643b0dfa6e33177116082acd47c1a93a9940 (diff) | |
New menu system migration
Diffstat (limited to 'engine/main.go')
| -rw-r--r-- | engine/main.go | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/engine/main.go b/engine/main.go index 9a8030a..de8ff34 100644 --- a/engine/main.go +++ b/engine/main.go @@ -38,41 +38,45 @@ func main() { } func menu_test() *ui.Menu { - return &ui.Menu{ + return &ui.Menu { PaddingX: 0.05, PaddingY: 0.1, - Spacing: 0.025, - Rows: []ui.UIElement { - &ui.GridRow { - HeightWeight: 1, - Spacing: 0.01, - Objects: []ui.UIElement { - &ui.Label{ Text: "First piece" }, - &ui.Label{ Text: "Wide piece", WidthWeight: 2 }, - &ui.Label{ Text: "Another piece" }, + Contents: &ui.GridColumn{ + Spacing: 0.025, + Objects: []ui.UIElement { + &ui.GridRow { + HeightWeight: 1, + Spacing: 0.01, + Objects: []ui.UIElement { + &ui.Label{ Text: "First piece" }, + &ui.Label{ Text: "Wide piece", WidthWeight: 2 }, + &ui.Label{ Text: "Another piece" }, + }, }, - }, - &ui.GridRow { - HeightWeight: 2, - Objects: []ui.UIElement { - &ui.Button { - EventType: ui.OnClick, - DisplayElement: &ui.Label { - Text: "Center button", - Alignment: ui.Center, - Style: ui.Style { - BacgroundColor: &rl.Pink, + &ui.GridRow { + HeightWeight: 2, + Objects: []ui.UIElement { + &ui.Button { + EventType: ui.OnClick, + DisplayElement: &ui.Label { + Text: "Center button", + Alignment: ui.Center, + Style: ui.Style { + BacgroundColor: &rl.Pink, + }, }, }, }, }, - }, - &ui.GridRow { - HeightWeight: 1, - Objects: []ui.UIElement { - &ui.Label{ Text: "A very very long text that is bigger than a window" }, + &ui.GridRow { + HeightWeight: 1, + Objects: []ui.UIElement { + &ui.Label{ Text: "A very very long text that is bigger than a window" }, + }, }, }, }, + // Rows: []ui.UIElement { + // }, } } |
