Struct carbide_core::Ui[][src]

pub struct Ui<S> where
    S: GlobalState
{ pub fonts: Map, pub win_w: f64, pub win_h: f64, pub widgets: Box<dyn Widget<S>>, pub environment: Environment<S>, // some fields omitted }

Ui is the most important type within carbide and is necessary for rendering and maintaining widget state.

Ui Handles the following:

  • Contains the state of all widgets which can be indexed via their widget::Id.
  • Stores rendering state for each widget until the end of each render cycle.
  • Contains the theme used for default styling of the widgets.
  • Maintains the latest user input state (for mouse and keyboard).
  • Maintains the latest window dimensions.

Fields

fonts: Map

Manages all fonts that have been loaded by the user.

win_w: f64

Window width.

win_h: f64

Window height.

widgets: Box<dyn Widget<S>>environment: Environment<S>

Implementations

impl<S: GlobalState> Ui<S>[src]

pub fn handle_event(&mut self, event: Input, global_state: &mut S)[src]

pub fn draw(&mut self) -> CPrimitives[src]

Draw the Ui in it's current state.

NOTE: If you don't need to redraw your carbide GUI every frame, it is recommended to use the Ui::draw_if_changed method instead.

pub fn mouse_cursor(&self) -> MouseCursor[src]

Get mouse cursor state.

Trait Implementations

impl<'a, S: GlobalState> AsRef<Ui<S>> for UiCell<'a, S>[src]

impl<S: Debug> Debug for Ui<S> where
    S: GlobalState
[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for Ui<S>[src]

impl<S> !Send for Ui<S>[src]

impl<S> !Sync for Ui<S>[src]

impl<S> Unpin for Ui<S>[src]

impl<S> !UnwindSafe for Ui<S>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,