aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
authorSan Jacobs2025-09-12 23:30:49 +0200
committerSan Jacobs2025-09-12 23:30:49 +0200
commit26e751ee3b1017738d23a36f891ba8c426e3f851 (patch)
tree4b0b629948d66d3c1b5cda2cea392a307c6ddb86 /src/main.odin
parentfefe11c52d98045f3e9b02580eb3e27819657934 (diff)
downloadtafl-26e751ee3b1017738d23a36f891ba8c426e3f851.tar.gz
tafl-26e751ee3b1017738d23a36f891ba8c426e3f851.tar.bz2
tafl-26e751ee3b1017738d23a36f891ba8c426e3f851.zip
Positioning!
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin65
1 files changed, 51 insertions, 14 deletions
diff --git a/src/main.odin b/src/main.odin
index 4ff1038..750f3b7 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -2,7 +2,6 @@ package main
import t "tafl"
-
main :: proc() {
width, height : i32 = 1920, 1080
@@ -20,12 +19,12 @@ main :: proc() {
sizing_width=t.FIXED(int(width)),
sizing_height=t.FIXED(int(height)),
layout=.LEFT_TO_RIGHT,
- color={1,.0,.0, 1},
- padding={300,300,300,300},
- child_gap=30,
+ color=colors.background,
+ padding={5,5,5,5},
+ child_gap=5,
)
- { // Blue left bar
- t.tafl(color={.1,.2,.3, 1},
+ { // Left bar
+ t.tafl(color=colors.panel_blackground,
sizing_height=t.GROW,
sizing_width=t.FIT,
layout=.TOP_TO_BOTTOM)
@@ -33,25 +32,50 @@ main :: proc() {
sizing_height=t.GROW,
sizing_width=t.GROW)}
{t.tafl(
- padding={4,4,4,4},
+ padding={8,8,8,8},
child_gap=4,
color={.0, .0, .0, 0.4},
)
button()
button()
button()
- button()
}
}
{ // Middle section
- t.tafl(color={.2,.2,.2, 1},
+ t.tafl(color=colors.panel_blackground,
sizing_width=t.GROW,
- sizing_height=t.GROW)
+ sizing_height=t.GROW,
+ position_horizontal=.MIDDLE,
+ position_vertical=.MIDDLE,
+ child_gap=5,
+ layout=.TOP_TO_BOTTOM,)
+ {// Red square
+ t.tafl(color={1,0,0,1},
+ sizing_width=t.FIXED(300),
+ sizing_height=t.FIXED(300),
+ padding={1,1,1,1},)
+ {
+ t.tafl(color={0,0,0,0.5},
+ sizing_width=t.GROW,
+ sizing_height=t.GROW)
+ }
+ }
+ {// Red square
+ t.tafl(color={1,0,0,1},
+ sizing_width=t.FIXED(200),
+ sizing_height=t.FIXED(200),
+ padding={1,1,1,1},)
+ {
+ t.tafl(color={0,0,0,0.5},
+ sizing_width=t.GROW,
+ sizing_height=t.GROW)
+ }
+ }
}
- { // Green right bar
- t.tafl(color={.1,.4,.1, 1},
+ { // Right bar
+ t.tafl(color=colors.panel_blackground,
sizing_width=t.FIXED(300),
sizing_height=t.GROW,
child_gap=20,
@@ -84,11 +108,24 @@ main :: proc() {
button :: proc() {
- t.tafl(sizing_width=t.FIXED(100),
+ t.tafl(sizing_width=t.FIXED(140),
sizing_height=t.FIXED(40),
- color={.1, .5, 1, 1},
+ color=colors.button_outline,
padding={2,2,2,2})
t.tafl(sizing_width=t.GROW,
sizing_height=t.GROW,
color={.1,.1,.1, 1})
+}
+
+
+Color_Scheme :: struct {
+ background : t.Color,
+ panel_blackground : t.Color,
+ button_outline : t.Color,
+}
+
+colors : Color_Scheme = {
+ background = {.1, .1, .1, 1},
+ panel_blackground = {.2, .2, .2, 1},
+ button_outline = {.1, .5, 1, 1},
} \ No newline at end of file