Skip to main content

RaylibDrawGui

Trait RaylibDrawGui 

Source
pub trait RaylibDrawGui {
Show 46 methods // Provided methods fn gui_enable(&mut self) { ... } fn gui_disable(&mut self) { ... } fn gui_lock(&mut self) { ... } fn gui_unlock(&mut self) { ... } fn gui_is_locked(&mut self) -> bool { ... } fn gui_fade(&mut self, color: Color, alpha: f32) -> Color { ... } fn gui_set_state(&mut self, state: GuiState) { ... } fn gui_get_state(&mut self) -> GuiState { ... } fn gui_set_font(&mut self, font: impl AsRef<Font>) { ... } fn gui_get_font(&mut self) -> WeakFont { ... } fn gui_set_style( &mut self, control: GuiControl, property: impl GuiProperty, value: i32, ) { ... } fn gui_set_alpha(&mut self, alpha: f32) { ... } fn gui_get_style( &self, control: GuiControl, property: impl GuiProperty, ) -> i32 { ... } fn gui_load_style(&mut self, filename: &str) { ... } fn gui_load_style_default(&mut self) { ... } fn gui_window_box( &mut self, bounds: impl Into<Rectangle>, title: &str, ) -> bool { ... } fn gui_group_box( &mut self, bounds: impl Into<Rectangle>, text: &str, ) -> bool { ... } fn gui_line(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool { ... } fn gui_panel(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool { ... } fn gui_scroll_panel( &mut self, bounds: impl Into<Rectangle>, text: &str, content: impl Into<Rectangle>, scroll: impl Into<Vector2>, view: impl Into<Rectangle>, ) -> (bool, Rectangle, Vector2) { ... } fn gui_label(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool { ... } fn gui_button(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool { ... } fn gui_label_button( &mut self, bounds: impl Into<Rectangle>, text: &str, ) -> bool { ... } fn gui_toggle( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut bool, ) -> bool { ... } fn gui_toggle_group( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32 { ... } fn gui_check_box( &mut self, bounds: impl Into<Rectangle>, text: &str, checked: &mut bool, ) -> bool { ... } fn gui_combo_box( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32 { ... } fn gui_dropdown_box( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, edit_mode: bool, ) -> bool { ... } fn gui_spinner( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut i32, min_value: i32, max_value: i32, edit_mode: bool, ) -> bool { ... } fn gui_value_box( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut i32, min_value: i32, max_value: i32, edit_mode: bool, ) -> bool { ... } fn gui_text_box( &mut self, bounds: impl Into<Rectangle>, buffer: &mut String, edit_mode: bool, ) -> bool { ... } fn gui_slider( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool { ... } fn gui_slider_bar( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool { ... } fn gui_progress_bar( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool { ... } fn gui_status_bar( &mut self, bounds: impl Into<Rectangle>, text: &str, ) -> bool { ... } fn gui_grid( &mut self, bounds: impl Into<Rectangle>, text: &str, spacing: f32, subdivs: i32, ) -> (bool, Vector2) { ... } fn gui_list_view( &mut self, bounds: impl Into<Rectangle>, text: &str, scroll_index: &mut i32, active: &mut i32, ) -> i32 { ... } fn gui_list_view_ex( &mut self, bounds: impl Into<Rectangle>, text: impl Iterator<Item = impl AsRef<str>>, focus: &mut i32, scroll_index: &mut i32, active: &mut i32, ) -> i32 { ... } fn gui_message_box( &mut self, bounds: impl Into<Rectangle>, text: &str, message: &str, buttons: &str, ) -> i32 { ... } fn gui_text_input_box( &mut self, bounds: impl Into<Rectangle>, title: &str, message: &str, buttons: &str, text: &mut String, text_max_size: i32, secret_view_active: &mut bool, ) -> i32 { ... } fn gui_color_picker( &mut self, bounds: impl Into<Rectangle>, text: &str, color: impl Into<Color>, ) -> Color { ... } fn gui_icon_text(&mut self, icon_id: GuiIconName, text: &str) -> String { ... } fn gui_color_bar_alpha( &mut self, bounds: impl Into<Rectangle>, text: &str, alpha: &mut f32, ) -> bool { ... } fn gui_toggle_slider( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> bool { ... } fn gui_dummy_rec( &mut self, bounds: impl Into<Rectangle>, text: &str, ) -> bool { ... } fn gui_color_bar_hue( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut f32, ) -> bool { ... }
}

Provided Methods§

Source

fn gui_enable(&mut self)

Enable gui controls (global state)

Source

fn gui_disable(&mut self)

Disable gui controls (global state)

Source

fn gui_lock(&mut self)

Lock gui controls (global state)

Source

fn gui_unlock(&mut self)

Unlock gui controls (global state)

Source

fn gui_is_locked(&mut self) -> bool

Check if gui is locked (global state)

Source

fn gui_fade(&mut self, color: Color, alpha: f32) -> Color

Source

fn gui_set_state(&mut self, state: GuiState)

Set gui state (global state)

Source

fn gui_get_state(&mut self) -> GuiState

Get gui state (global state)

Source

fn gui_set_font(&mut self, font: impl AsRef<Font>)

Set gui custom font (global state)

Source

fn gui_get_font(&mut self) -> WeakFont

Get gui custom font (global state)

Source

fn gui_set_style( &mut self, control: GuiControl, property: impl GuiProperty, value: i32, )

Set one style property

Source

fn gui_set_alpha(&mut self, alpha: f32)

Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

Source

fn gui_get_style(&self, control: GuiControl, property: impl GuiProperty) -> i32

Get one style property

Source

fn gui_load_style(&mut self, filename: &str)

Load style file (.rgs)

Source

fn gui_load_style_default(&mut self)

Load style default over global style

Source

fn gui_window_box(&mut self, bounds: impl Into<Rectangle>, title: &str) -> bool

Window Box control, shows a window that can be closed

Source

fn gui_group_box(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Group Box control with text name

Source

fn gui_line(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Line separator control, could contain text

Source

fn gui_panel(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Panel control, useful to group controls

Source

fn gui_scroll_panel( &mut self, bounds: impl Into<Rectangle>, text: &str, content: impl Into<Rectangle>, scroll: impl Into<Vector2>, view: impl Into<Rectangle>, ) -> (bool, Rectangle, Vector2)

Scroll Panel control

Source

fn gui_label(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Label control, shows text

Source

fn gui_button(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Button control, returns true when clicked

Source

fn gui_label_button(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Label button control, show true when clicked

Source

fn gui_toggle( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut bool, ) -> bool

Toggle Button control, returns true when active

Source

fn gui_toggle_group( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32

Toggle Group control, returns active toggle index

Source

fn gui_check_box( &mut self, bounds: impl Into<Rectangle>, text: &str, checked: &mut bool, ) -> bool

Check Box control, returns true when active

Source

fn gui_combo_box( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32

Combo Box control, returns selected item index

Source

fn gui_dropdown_box( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, edit_mode: bool, ) -> bool

Dropdown Box control, returns selected item

Source

fn gui_spinner( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut i32, min_value: i32, max_value: i32, edit_mode: bool, ) -> bool

Spinner control, returns selected value

Source

fn gui_value_box( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut i32, min_value: i32, max_value: i32, edit_mode: bool, ) -> bool

Value Box control, updates input text with numbers

Source

fn gui_text_box( &mut self, bounds: impl Into<Rectangle>, buffer: &mut String, edit_mode: bool, ) -> bool

Text Box control, updates input text Use at your own risk!!! The allocated vector MUST have enough space for edits.

Source

fn gui_slider( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool

Slider control, returns selected value

Source

fn gui_slider_bar( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool

Slider Bar control, returns selected value

Source

fn gui_progress_bar( &mut self, bounds: impl Into<Rectangle>, text_left: &str, text_right: &str, value: &mut f32, min_value: f32, max_value: f32, ) -> bool

Progress Bar control, shows current progress value

Source

fn gui_status_bar(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Status Bar control, shows info text

Source

fn gui_grid( &mut self, bounds: impl Into<Rectangle>, text: &str, spacing: f32, subdivs: i32, ) -> (bool, Vector2)

Grid control

Source

fn gui_list_view( &mut self, bounds: impl Into<Rectangle>, text: &str, scroll_index: &mut i32, active: &mut i32, ) -> i32

List View control, returns selected list item index

Source

fn gui_list_view_ex( &mut self, bounds: impl Into<Rectangle>, text: impl Iterator<Item = impl AsRef<str>>, focus: &mut i32, scroll_index: &mut i32, active: &mut i32, ) -> i32

List View with extended parameters

Source

fn gui_message_box( &mut self, bounds: impl Into<Rectangle>, text: &str, message: &str, buttons: &str, ) -> i32

Message Box control, displays a message

Source

fn gui_text_input_box( &mut self, bounds: impl Into<Rectangle>, title: &str, message: &str, buttons: &str, text: &mut String, text_max_size: i32, secret_view_active: &mut bool, ) -> i32

Text Input Box control, ask for text

Source

fn gui_color_picker( &mut self, bounds: impl Into<Rectangle>, text: &str, color: impl Into<Color>, ) -> Color

Color Picker control

Source

fn gui_icon_text(&mut self, icon_id: GuiIconName, text: &str) -> String

Source

fn gui_color_bar_alpha( &mut self, bounds: impl Into<Rectangle>, text: &str, alpha: &mut f32, ) -> bool

Color Bar Alpha control NOTE: Returns alpha value normalized [0..1]

Source

fn gui_toggle_slider( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> bool

Toggle Slider control

Source

fn gui_dummy_rec(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool

Dummy control for placeholders

Source

fn gui_color_bar_hue( &mut self, bounds: impl Into<Rectangle>, text: &str, value: &mut f32, ) -> bool

Color Bar Hue control

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D> RaylibDrawGui for D
where D: RaylibDraw,