From b98d216add98579c3a91b74fa5233f8534200297 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Thu, 21 May 2026 06:46:48 -0400 Subject: a buncha ui stuff idk even know anymore --- dc/dc.c | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'dc/dc.c') diff --git a/dc/dc.c b/dc/dc.c index 93fa220..0b2c772 100644 --- a/dc/dc.c +++ b/dc/dc.c @@ -65,34 +65,27 @@ void tick(void) double frame_time = ty_get_time() - last_frame; last_frame = ty_get_time(); - tyui_layout((float[]){0.25, 0}); - tyui_text("%.2g ms", frame_time * 1000); - tyui_text("%.2d fps", (int)(1.0 / frame_time)); - tyui_layout(NULL); - tyui_text("%d", (int)ty_get_time()); - tyui_text("abcdefghijklmnopqrstuvwxyz"); - tyui_text("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - tyui_text("0123456789"); - tyui_text("!\"'#$%&()*+,-./@[]\\"); - tyui_text("^_`{}|~:;<>=? "); - - if (tyui_begin_window("Test Window", ty_recti(5, 5, 100, 100), &winid)) { - for (int i = 0; i < 3; i++) - tyui_text("example text"); - if (tyui_button("press me")) - toggled = !toggled; - - tyui_layout((float[]){0.1, 0.2, 0}); - static float xvalue = 10; - tyui_text("x"); - tyui_text("%g", xvalue); - tyui_slider(0, 100, 5, &xvalue); - - static float yvalue = 50; - tyui_text("y"); - tyui_text("%g", yvalue); - tyui_slider(0, 100, 5, &yvalue); - tyui_layout(NULL); + if (tyui_begin_window("Test Window", ty_recti(5, 5, 100, 120), &winid)) { + tyui_button("before"); + + tyui_push_layout((float[]){0.5, -1, 0}); + tyui_push_layout((float[]){-1, 0}); + tyui_text_ex(TYUI_ALIGN_CENTER, "Buttons"); + tyui_button("test1"); + tyui_button("test2"); + tyui_button("test3"); + tyui_button("test4"); + tyui_button("test5"); + tyui_pop_layout(); + + tyui_push_layout((float[]){-1, 0}); + tyui_text_ex(TYUI_ALIGN_CENTER, "Stats"); + tyui_text_ex(TYUI_ALIGN_RIGHT, "%.2g ms", frame_time * 1000); + tyui_text_ex(TYUI_ALIGN_RIGHT, "%.2d fps", (int)(1.0 / frame_time)); + tyui_pop_layout(); + tyui_pop_layout(); + + tyui_button("after"); tyui_end_window(); } -- cgit v1.3-2-g0d8e