ui
17 items · generated by scribe fromstdlib/ui.fd· synced 2026-11-15
Contents
- UiContext (struct)
- ui_create (function)
- ui_begin (function)
- ui_end (function)
- ui_button (function)
- ui_slider (function)
- ui_checkbox (function)
- ui_label (function)
- ui_panel (function)
- ui_progress_bar (function)
- ui_text_input (function)
- ui_separator (function)
- ui_next_row (function)
UiContext
pub struct UiContext {Fields:
| Name | Type |
|---|---|
ren | i64 |
mouse_x | i64 |
mouse_y | i64 |
mouse_down | bool |
mouse_pressed | bool |
hot | i64 |
active | i64 |
next_id | i64 |
text_color_r | i64 |
text_color_g | i64 |
text_color_b | i64 |
bg_color_r | i64 |
bg_color_g | i64 |
bg_color_b | i64 |
hover_color_r | i64 |
hover_color_g | i64 |
hover_color_b | i64 |
active_color_r | i64 |
active_color_g | i64 |
active_color_b | i64 |
Defined at line 24
ui_create
Create a UI context.
pub fn ui_create() -> UiContext {Returns: UiContext
Defined at line 53
ui_begin
Begin a UI frame. Pass the SDL renderer and input state.
pub fn ui_begin(ctx: & mut UiContext, ren: i64, input: & SdlInputState) -> void {Parameters:
ctx:& mut UiContextren:i64input:& SdlInputState
Returns: void
Defined at line 60
ui_end
End a UI frame.
pub fn ui_end(ctx: & mut UiContext) -> void {Parameters:
ctx:& mut UiContext
Returns: void
Defined at line 71
ui_button
Draw a button. Returns true if the button was clicked this frame.
pub fn ui_button(ctx: & mut UiContext, label: str, x: i64, y: i64, w: i64, h: i64) -> bool {Parameters:
ctx:& mut UiContextlabel:strx:i64y:i64w:i64h:i64
Returns: bool
Defined at line 129
ui_slider
Draw a slider. Returns the new value (or the same value if unchanged).
pub fn ui_slider(ctx: & mut UiContext, x: i64, y: i64, w: i64, h: i64, min: f64, max: f64, value: f64) -> f64 {Parameters:
ctx:& mut UiContextx:i64y:i64w:i64h:i64min:f64max:f64value:f64
Returns: f64
Defined at line 176
ui_checkbox
Draw a checkbox. Returns the new checked state.
pub fn ui_checkbox(ctx: & mut UiContext, label: str, x: i64, y: i64, checked: bool) -> bool {Parameters:
ctx:& mut UiContextlabel:strx:i64y:i64checked:bool
Returns: bool
Defined at line 234
ui_label
Draw a label (non-interactive text).
pub fn ui_label(ctx: & UiContext, text: str, x: i64, y: i64) -> void {Parameters:
ctx:& UiContexttext:strx:i64y:i64
Returns: void
Defined at line 277
ui_panel
Draw a panel background.
pub fn ui_panel(ctx: & UiContext, x: i64, y: i64, w: i64, h: i64) -> void {Parameters:
ctx:& UiContextx:i64y:i64w:i64h:i64
Returns: void
Defined at line 282
ui_progress_bar
Draw a progress bar.
pub fn ui_progress_bar(ctx: & UiContext, x: i64, y: i64, w: i64, h: i64, progress: f64) -> void {Parameters:
ctx:& UiContextx:i64y:i64w:i64h:i64progress:f64
Returns: void
Defined at line 288
ui_text_input
Draw a text input field (simplified — no actual text editing).
pub fn ui_text_input(ctx: & mut UiContext, x: i64, y: i64, w: i64, h: i64, text: str) -> str {Parameters:
ctx:& mut UiContextx:i64y:i64w:i64h:i64text:str
Returns: str
Defined at line 306
ui_separator
Draw a separator line.
pub fn ui_separator(ctx: & UiContext, x: i64, y: i64, w: i64) -> void {Parameters:
ctx:& UiContextx:i64y:i64w:i64
Returns: void
Defined at line 337
ui_next_row
Draw a column layout helper (returns next y position).
pub fn ui_next_row(y: i64, h: i64, spacing: i64) -> i64 {Parameters:
y:i64h:i64spacing:i64
Returns: i64
Defined at line 343
Generated by scribe, the Fides documentation generator