¶
luxe
API (2025.1.2
)¶
luxe: ui/button
module¶
UIButton¶
import "luxe: ui/button" for UIButton
UIButton
is aControl
that represents a clickable button with optional text content.var btn = UIButton.create(ui) UIButton.set_text(btn, "click me!") Control.set_events(btn) {|event| if(event.type == UIEvent.release) { Log.print("clicked button") } }
- create(ui_entity:
Entity
) - set_text(control:
UIButton
, text:String
) - set_outline(control:
UIButton
, radius:Num
, softness:Num
, color:Color
, offset:Float2
) - set_shadow(control:
UIButton
, radius:Num
, softness:Num
, color:Color
, offset:Float2
) - get_text(control:
UIButton
) - set_font(control:
UIButton
, font:String
) - get_font(control:
UIButton
) - set_color(control:
UIButton
, color:Color
) - get_color(control:
UIButton
) - set_text_size(control:
UIButton
, size:Num
) - get_text_size(control:
UIButton
) - set_align(control:
UIButton
, align:TextAlign
) - get_align(control:
UIButton
) - set_align_vertical(control:
UIButton
, align:TextAlign
) - get_align_vertical(control:
UIButton
) - get_render_text(control:
UIButton
) - set_colors(control:
UIButton
, bg:Color
, bg_hover:Color
, border:Color
, border_hover:Color
)
Entity
)
¶UIButton
Create a new button control.
UIButton
, text: String
)
¶None
Set the text displayed on a button.
UIButton
, radius: Num
, softness: Num
, color: Color
, offset: Float2
)
¶None
Set the text outline parameters.
UIButton
, radius: Num
, softness: Num
, color: Color
, offset: Float2
)
¶None
Set the text shadow parameters.
UIButton
)
¶String
Get the text displayed on a button.
UIButton
, font: String
)
¶None
Set the font of the text on a button.
UIButton
)
¶Id32
Get the font asset id of the text on the button. The asset id is returned as the string hash, to get the string use
Strings.get
.
UIButton
, color: Color
)
¶None
Set the color of a button.
UIButton
)
¶Color
Get the color of a button.
UIButton
, size: Num
)
¶None
Set the size of the text on a button.
UIButton
)
¶Num
Get the size of the text on a button.
UIButton
, align: TextAlign
)
¶None
Set the horizontal alignment of the text on a button.
UIButton
)
¶TextAlign
Get the horizontal alignment of the text on a button.
UIButton
, align: TextAlign
)
¶None
Set the vertical alignment of the text on a button.
UIButton
)
¶TextAlign
Get the vertical alignment of the text on a button.
UIButton
)
¶RenderText
Get the underlying lowlevel text render object. Usable with the
Render.text_*
API.
UIButton
, bg: Color
, bg_hover: Color
, border: Color
, border_hover: Color
)
¶unknown
no docs found