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§
Sourcefn gui_enable(&mut self)
fn gui_enable(&mut self)
Enable gui controls (global state)
Sourcefn gui_disable(&mut self)
fn gui_disable(&mut self)
Disable gui controls (global state)
Sourcefn gui_unlock(&mut self)
fn gui_unlock(&mut self)
Unlock gui controls (global state)
Sourcefn gui_is_locked(&mut self) -> bool
fn gui_is_locked(&mut self) -> bool
Check if gui is locked (global state)
fn gui_fade(&mut self, color: Color, alpha: f32) -> Color
Sourcefn gui_set_state(&mut self, state: GuiState)
fn gui_set_state(&mut self, state: GuiState)
Set gui state (global state)
Sourcefn gui_get_state(&mut self) -> GuiState
fn gui_get_state(&mut self) -> GuiState
Get gui state (global state)
Sourcefn gui_set_font(&mut self, font: impl AsRef<Font>)
fn gui_set_font(&mut self, font: impl AsRef<Font>)
Set gui custom font (global state)
Sourcefn gui_get_font(&mut self) -> WeakFont
fn gui_get_font(&mut self) -> WeakFont
Get gui custom font (global state)
Sourcefn gui_set_style(
&mut self,
control: GuiControl,
property: impl GuiProperty,
value: i32,
)
fn gui_set_style( &mut self, control: GuiControl, property: impl GuiProperty, value: i32, )
Set one style property
Sourcefn gui_set_alpha(&mut self, alpha: f32)
fn gui_set_alpha(&mut self, alpha: f32)
Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
Sourcefn gui_get_style(&self, control: GuiControl, property: impl GuiProperty) -> i32
fn gui_get_style(&self, control: GuiControl, property: impl GuiProperty) -> i32
Get one style property
Sourcefn gui_load_style(&mut self, filename: &str)
fn gui_load_style(&mut self, filename: &str)
Load style file (.rgs)
Sourcefn gui_load_style_default(&mut self)
fn gui_load_style_default(&mut self)
Load style default over global style
Sourcefn gui_window_box(&mut self, bounds: impl Into<Rectangle>, title: &str) -> bool
fn gui_window_box(&mut self, bounds: impl Into<Rectangle>, title: &str) -> bool
Window Box control, shows a window that can be closed
Sourcefn gui_group_box(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
fn gui_group_box(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
Group Box control with text name
Sourcefn gui_line(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
fn gui_line(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
Line separator control, could contain text
Sourcefn gui_panel(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
fn gui_panel(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
Panel control, useful to group controls
Sourcefn 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_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
Sourcefn gui_label(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
fn gui_label(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
Label control, shows text
Button control, returns true when clicked
Label button control, show true when clicked
Sourcefn gui_toggle(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
active: &mut bool,
) -> bool
fn gui_toggle( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut bool, ) -> bool
Toggle Button control, returns true when active
Sourcefn gui_toggle_group(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
active: &mut i32,
) -> i32
fn gui_toggle_group( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32
Toggle Group control, returns active toggle index
Sourcefn gui_check_box(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
checked: &mut bool,
) -> bool
fn gui_check_box( &mut self, bounds: impl Into<Rectangle>, text: &str, checked: &mut bool, ) -> bool
Check Box control, returns true when active
Sourcefn gui_combo_box(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
active: &mut i32,
) -> i32
fn gui_combo_box( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> i32
Combo Box control, returns selected item index
Sourcefn gui_dropdown_box(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
active: &mut i32,
edit_mode: bool,
) -> bool
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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn gui_text_box(
&mut self,
bounds: impl Into<Rectangle>,
buffer: &mut String,
edit_mode: bool,
) -> bool
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.
Sourcefn 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( &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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn gui_status_bar(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
fn gui_status_bar(&mut self, bounds: impl Into<Rectangle>, text: &str) -> bool
Status Bar control, shows info text
Sourcefn gui_grid(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
spacing: f32,
subdivs: i32,
) -> (bool, Vector2)
fn gui_grid( &mut self, bounds: impl Into<Rectangle>, text: &str, spacing: f32, subdivs: i32, ) -> (bool, Vector2)
Grid control
Sourcefn gui_list_view(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
scroll_index: &mut i32,
active: &mut i32,
) -> i32
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
Sourcefn 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_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
Sourcefn gui_message_box(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
message: &str,
buttons: &str,
) -> i32
fn gui_message_box( &mut self, bounds: impl Into<Rectangle>, text: &str, message: &str, buttons: &str, ) -> i32
Message Box control, displays a message
Sourcefn 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_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
Sourcefn gui_color_picker(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
color: impl Into<Color>,
) -> Color
fn gui_color_picker( &mut self, bounds: impl Into<Rectangle>, text: &str, color: impl Into<Color>, ) -> Color
Color Picker control
fn gui_icon_text(&mut self, icon_id: GuiIconName, text: &str) -> String
Sourcefn gui_color_bar_alpha(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
alpha: &mut f32,
) -> bool
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]
Sourcefn gui_toggle_slider(
&mut self,
bounds: impl Into<Rectangle>,
text: &str,
active: &mut i32,
) -> bool
fn gui_toggle_slider( &mut self, bounds: impl Into<Rectangle>, text: &str, active: &mut i32, ) -> bool
Toggle Slider 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.