1.44mb-gamejam

submission for the 1.44mb game jam - https://2pgarcade.com/contest-144mb.html
git clone git://brookjeynes.dev/bjeynes/1.44mb-gamejam.git
Log | Files | Refs

commit 533172fd4acf18dda61826c56c9ebf875d0e6143
parent 2fe84e94cecc71ae5e67988e8226eb772718d4c0
Author: brookjeynes <me@brookjeynes.dev>
Date:   Fri,  7 Aug 2026 11:16:30 +1000

ui: center start button text

Signed-off-by: brookjeynes <me@brookjeynes.dev>

Diffstat:
Msrc/main.zig | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main.zig b/src/main.zig @@ -44,11 +44,15 @@ pub fn main() !void { start_button.size, raylib.BLACK, ); + + const start_button_text = "start"; + const start_button_font_size: f32 = 18.0; + const start_button_text_width = raylib.MeasureText(start_button_text, start_button_font_size); raylib.DrawText( - "start", - @intFromFloat(start_button.position.x + (start_button.size.x / 2)), - @intFromFloat(start_button.position.y + (start_button.size.y / 2)), - 18, + start_button_text, + @intFromFloat(start_button.position.x + (start_button.size.x - @as(f32, @floatFromInt(start_button_text_width))) / 2), + @intFromFloat(start_button.position.y + (start_button.size.y - start_button_font_size) / 2), + start_button_font_size, raylib.WHITE, );