From: Brendan Hansen Date: Sat, 12 Jun 2021 13:27:36 +0000 (-0500) Subject: added radio button test X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=d298f287b608447c2ecdb9eed779a613d718709f;p=tower.git added radio button test --- diff --git a/src/tower.onyx b/src/tower.onyx index 0077bd1..aca6adc 100644 --- a/src/tower.onyx +++ b/src/tower.onyx @@ -97,6 +97,13 @@ test_button_count := 1; check_buttons : [10] bool slider_values : [7] f32 +radio_options :: enum { + Apples; + Bananas; + Coconut; +} +radio_value := radio_options.Apples; + draw :: () { gl.clearColor(0, 0, 0, 1); gl.clear(gl.COLOR_BUFFER_BIT); @@ -164,7 +171,16 @@ draw :: () { if !check_buttons[5] && i > 5 do break; } - ui.draw_text(slider_panel, "This text is underneath all of the sliders!"); + + radio: ui.Rectangle; + radio, slider_panel = split_horizontal(slider_panel, top_height=32); + ui.radio(padding(radio, left=12), ^radio_value, .Apples, "Apples"); + + radio, slider_panel = split_horizontal(slider_panel, top_height=32); + ui.radio(padding(radio, left=12), ^radio_value, .Bananas, "Bananas"); + + radio, slider_panel = split_horizontal(slider_panel, top_height=32); + ui.radio(padding(radio, left=12), ^radio_value, .Coconut, "Coconut"); } {