class

GSDL::UI::Checkbox

Inherits GSDL::UI::Container < GSDL::UI::Element < Reference < Object

Constructors

new(text : String = "", checked : Bool = false, width : Int32 = FitContent, height : Int32 = FitContent, x : Int32 = 0, y : Int32 = 0, anchor : Anchor = Anchor::Center, font_size : Num = 16, default_background_color : Color | String = ColorScheme.get(:ui_checkbox_bg, Color.parse("#1e1e24")), hover_background_color : Color | String = ColorScheme.get(:ui_checkbox_hover_bg, Color.parse("#2e2e38")), default_text_color : Color | String = ColorScheme.get(:ui_checkbox_text, ColorScheme.get(:ui_text, Color.parse("#f4f4f5"))), hover_text_color : Color | String = ColorScheme.get(:ui_checkbox_hover_text, ColorScheme.get(:main, Color.parse("#7c3aed"))), on_toggle : Proc(Bool, Nil) | Nil = nil, padding : SpacingInput = 0, margin : SpacingInput = 0, flex : UInt8 = 0_u8, box_size : Int32 | Nil = nil, inner_size : Int32 | Nil = nil, label_offset_x : Int32 | Nil = nil)
Source
new(*args, **kwargs)
Source
new(*args, **kwargs, &)
Source

Instance methods

box_size
Source
box_size=(box_size : Int32)
Source
checked=(checked : Bool)
Source
checked?
Source
custom_indicator
Source
custom_indicator=(custom_indicator : Proc(Draw, Checkbox, Rect, Bool, Nil) | Nil)
Source
default_background_color
Source
default_background_color=(default_background_color : Color)
Source
default_text_color
Source
default_text_color=(default_text_color : Color)
Source
draw(draw : Draw)
Source
height
Source
hover_background_color
Source
hover_background_color=(hover_background_color : Color)
Source
hover_text_color
Source
hover_text_color=(hover_text_color : Color)
Source
hovered=(value : Bool)
Source
inner_size
Source
inner_size=(inner_size : Int32)
Source
label
Source
layout!
Source
on_toggle
Source
on_toggle=(on_toggle : Proc(Bool, Nil) | Nil)
Source
update(dt : Float32)
Source