diff options
| author | iamcheeseman <[email protected]> | 2026-05-21 06:46:48 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-21 06:46:48 -0400 |
| commit | b98d216add98579c3a91b74fa5233f8534200297 (patch) | |
| tree | eb631f8b853ef913806e8a8c0fb52e8eb8aa37a7 /dc | |
| parent | db639fcdc501ac56873f55d1c227e15581ee97c3 (diff) | |
a buncha ui stuff idk even know anymore
Diffstat (limited to 'dc')
| -rw-r--r-- | dc/dc.c | 45 |
1 files changed, 19 insertions, 26 deletions
@@ -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, 120), &winid)) { + tyui_button("before"); - 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); + 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(); - static float yvalue = 50; - tyui_text("y"); - tyui_text("%g", yvalue); - tyui_slider(0, 100, 5, &yvalue); - tyui_layout(NULL); + 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(); } |
