diff --git a/editor/editor_ui.jai b/editor/editor_ui.jai index f9215cc..2f96207 100644 --- a/editor/editor_ui.jai +++ b/editor/editor_ui.jai @@ -55,6 +55,7 @@ editor_ui :: () { } ui_window_begin("Entities", 1, 5, 200, 600); + checked := ui_checkbox(true); if engine.current_scene != null { for engine.current_scene.entities { if it.flags & .DELETED continue; diff --git a/ui/widgets.jai b/ui/widgets.jai index 127f2dd..37f5335 100644 --- a/ui/widgets.jai +++ b/ui/widgets.jai @@ -29,6 +29,26 @@ ui_button :: (text: string, identifier: s64 = 0, loc := #caller_location) -> cli return box.interaction.clicked, box.interaction; } +ui_checkbox :: (checked: bool, identifier: s64 = 0, loc := #caller_location) -> bool { + ui_set_next_background_color(.{0.2,0.2,0.2,1}); + ui_set_next_text_color(.{1,1,1,1}); + ui_set_next_size_x(.PIXELS, 20); + ui_set_next_size_y(.PIXELS, 20); + ui_set_next_padding(5); + //ui_set_next_text_alignment(CENTER_HORIZONTALLY | .CENTER_VERTICALLY); + + box := ui_box_make(.CLICKABLE | .DRAW_BORDER | .DRAW_TEXT | .DRAW_BACKGROUND | .ANIMATE_ON_HOVER, get_hash(loc, identifier)); + ui_push_parent(box, .LEFT, .HORIZONTAL); + { + //ui_set_next_padding(5); + ui_set_next_background_color(.{1.0,1.0,1.0,1}); + inner_box := ui_box_make(.DRAW_TEXT | .DRAW_BACKGROUND, get_hash(loc, 1)); + } + ui_pop_parent(); + + return box.interaction.clicked; +} + ui_button_with_texture :: (texture_handle: Texture_Handle, identifier: s64 = 0, loc := #caller_location) -> clicked: bool, Interaction_State { ui_set_next_texture(texture_handle); ui_set_next_size_x(.PIXELS, 20);