Skip to content

stdlib/uiView source ↗

ui

17 items · generated by scribe fromstdlib/ui.fd· synced 2026-11-15

stdlib/ui17 items

Contents

UiContext

pub struct UiContext {

Fields:

NameType
reni64
mouse_xi64
mouse_yi64
mouse_downbool
mouse_pressedbool
hoti64
activei64
next_idi64
text_color_ri64
text_color_gi64
text_color_bi64
bg_color_ri64
bg_color_gi64
bg_color_bi64
hover_color_ri64
hover_color_gi64
hover_color_bi64
active_color_ri64
active_color_gi64
active_color_bi64

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 UiContext
  • ren: i64
  • input: & 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 UiContext
  • label: str
  • x: i64
  • y: i64
  • w: i64
  • h: 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 UiContext
  • x: i64
  • y: i64
  • w: i64
  • h: i64
  • min: f64
  • max: f64
  • value: 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 UiContext
  • label: str
  • x: i64
  • y: i64
  • checked: 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: & UiContext
  • text: str
  • x: i64
  • y: 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: & UiContext
  • x: i64
  • y: i64
  • w: i64
  • h: 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: & UiContext
  • x: i64
  • y: i64
  • w: i64
  • h: i64
  • progress: 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 UiContext
  • x: i64
  • y: i64
  • w: i64
  • h: i64
  • text: 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: & UiContext
  • x: i64
  • y: i64
  • w: 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: i64
  • h: i64
  • spacing: i64

Returns: i64

Defined at line 343


Generated by scribe, the Fides documentation generator