Io

Struct Io 

Source
pub struct Io(/* private fields */);
Expand description

Settings and inputs/outputs for imgui-rs This is a transparent wrapper around ImGuiIO

Implementations§

Source§

impl Io

Source

pub fn display_size(&self) -> [f32; 2]

Main display size in pixels

Source

pub fn set_display_size(&mut self, size: [f32; 2])

Set main display size in pixels

Source

pub fn delta_time(&self) -> f32

Time elapsed since last frame, in seconds

Source

pub fn set_delta_time(&mut self, delta_time: f32)

Set time elapsed since last frame, in seconds

Source

pub fn mouse_pos(&self) -> [f32; 2]

Mouse position, in pixels

Source

pub fn set_mouse_pos(&mut self, pos: [f32; 2])

Set mouse position, in pixels

Source

pub fn mouse_wheel(&self) -> f32

Mouse wheel vertical scrolling

Source

pub fn set_mouse_wheel(&mut self, wheel: f32)

Set mouse wheel vertical scrolling

Source

pub fn mouse_wheel_h(&self) -> f32

Mouse wheel horizontal scrolling

Source

pub fn set_mouse_wheel_h(&mut self, wheel_h: f32)

Set mouse wheel horizontal scrolling

Source

pub fn mouse_down(&self, button: usize) -> bool

Check if a mouse button is down

Source

pub fn set_mouse_down(&mut self, button: usize, down: bool)

Set mouse button state

Source

pub fn want_capture_mouse(&self) -> bool

Check if imgui wants to capture mouse input

Source

pub fn want_capture_keyboard(&self) -> bool

Check if imgui wants to capture keyboard input

Source

pub fn want_text_input(&self) -> bool

Check if imgui wants to use text input

Source

pub fn want_set_mouse_pos(&self) -> bool

Check if imgui wants to set mouse position

Source

pub fn mouse_draw_cursor(&self) -> bool

Whether ImGui requests software-drawn mouse cursor

Source

pub fn set_mouse_draw_cursor(&mut self, draw: bool)

Enable or disable software-drawn mouse cursor

Source

pub fn want_save_ini_settings(&self) -> bool

Check if imgui wants to save ini settings

Source

pub fn framerate(&self) -> f32

Framerate estimation, in frames per second

Source

pub fn metrics_render_vertices(&self) -> i32

Vertices output during last call to render

Source

pub fn metrics_render_indices(&self) -> i32

Indices output during last call to render

Source

pub fn metrics_render_windows(&self) -> i32

Number of visible windows

Source

pub fn metrics_active_windows(&self) -> i32

Number of active windows

Source

pub fn config_flags(&self) -> ConfigFlags

Configuration flags

Source

pub fn set_config_flags(&mut self, flags: ConfigFlags)

Set configuration flags

Source

pub fn backend_flags(&self) -> BackendFlags

Backend flags

Source

pub fn set_backend_flags(&mut self, flags: BackendFlags)

Set backend flags

Source

pub fn add_key_event(&mut self, key: Key, down: bool)

Add a key event to the input queue

Source

pub fn add_input_character(&mut self, character: char)

Add a character input event to the input queue

Source

pub fn add_mouse_pos_event(&mut self, pos: [f32; 2])

Add a mouse position event to the input queue

Source

pub fn add_mouse_button_event(&mut self, button: MouseButton, down: bool)

Add a mouse button event to the input queue

Source

pub fn add_mouse_wheel_event(&mut self, wheel: [f32; 2])

Add a mouse wheel event to the input queue

Source

pub fn add_focus_event(&mut self, focused: bool)

Notify Dear ImGui that the application window gained or lost focus This mirrors io.AddFocusEvent() in Dear ImGui and is used by platform backends.

Source

pub fn font_global_scale(&self) -> f32

Get the global font scale (not available in current Dear ImGui version) Compatibility shim: maps to style.FontScaleMain (Dear ImGui 1.92+)

Source

pub fn set_font_global_scale(&mut self, _scale: f32)

Set the global font scale (not available in current Dear ImGui version) Compatibility shim: maps to style.FontScaleMain (Dear ImGui 1.92+)

Source

pub fn display_framebuffer_scale(&self) -> [f32; 2]

Get the display framebuffer scale

Source

pub fn set_display_framebuffer_scale(&mut self, scale: [f32; 2])

Set the display framebuffer scale This is important for HiDPI displays to ensure proper rendering

Auto Trait Implementations§

§

impl Freeze for Io

§

impl RefUnwindSafe for Io

§

impl !Send for Io

§

impl !Sync for Io

§

impl Unpin for Io

§

impl UnwindSafe for Io

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more