[−][src]Struct mergui::Context
This manages the GUI. It contains every widget that needs to be drawn and makes sure they are updated properly
Methods
impl<'a> Context<'a>
[src]
pub fn new(cursor: Vector, start_z: u32) -> Self
[src]
Due to bug 434 in quicksilver, the draw order of draw calls without a "z" value is unspecified
To get arround this, the context will draw every widget with its own Z value.
It draws the first widget with start_z and increases it by one for every widget, resseting this back to start_z every frame
pub fn add_layer(&mut self) -> LayerId
[src]
Adds a layer that can hold multiple widgets. Usefull to group widgets together that need to be removed at the same time
pub fn event(&mut self, event: &Event, window: &mut Window)
[src]
Call this in the event function of the state to update every widget.
pub fn render<Store: Assets>(&mut self, assets: &Store, window: &mut Window)
[src]
Call this in the render function of your state to render every widget
pub fn add_widget<R, W, Res>(
&mut self,
widget: R,
layer_id: &LayerId
) -> Result<Response<Res>, ()> where
R: WidgetConfig<Res, W>,
W: Widget + 'a,
Res: Sized,
[src]
&mut self,
widget: R,
layer_id: &LayerId
) -> Result<Response<Res>, ()> where
R: WidgetConfig<Res, W>,
W: Widget + 'a,
Res: Sized,
Adds a widget configuration to a given layer.
Returns an Error if the layer does not exist.
Otherwise, returns both the id of the widget AND a channel to comunicate with it.
Auto Trait Implementations
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
impl<'a> !RefUnwindSafe for Context<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Downcast for T where
T: Any,
T: Any,