Struct widgetry::EventCtx[][src]

pub struct EventCtx<'a> {
    pub(crate) fake_mouseover: bool,
    pub input: UserInput,
    pub canvas: &'a mut Canvas,
    pub prerender: &'a Prerender,
    pub(crate) style: &'a mut Style,
    pub(crate) updates_requested: Vec<UpdateType>,
}

Fields

fake_mouseover: boolinput: UserInputcanvas: &'a mut Canvasprerender: &'a Prerenderstyle: &'a mut Styleupdates_requested: Vec<UpdateType>

Implementations

impl<'a> EventCtx<'a>[src]

pub fn loading_screen<O, S: Into<String>, F: FnOnce(&mut EventCtx<'_>, &mut Timer<'_>) -> O>(
    &mut self,
    raw_timer_name: S,
    f: F
) -> O
[src]

pub fn request_update(&mut self, update_type: UpdateType)[src]

pub fn canvas_movement(&mut self) -> bool[src]

Allow panning and zooming on the canvas. Exactly which controls are active (click-and-drag, auto-pan at the edge of the screen, using arrow keys, etc) depend on options set. Returns true if the canvas moved at all.

pub fn no_op_event<O, F: FnMut(&mut EventCtx<'_>) -> O>(
    &mut self,
    fake_mouseover: bool,
    cb: F
) -> O
[src]

pub fn redo_mouseover(&self) -> bool[src]

pub fn normal_left_click(&mut self) -> bool[src]

fn is_dragging(&self) -> bool[src]

pub fn is_key_down(&self, key: Key) -> bool[src]

pub fn default_line_height(&self) -> f64[src]

pub fn upload(&self, batch: GeomBatch) -> Drawable[src]

pub(crate) fn cursor_clickable(&mut self)[src]

pub fn style(&self) -> &Style[src]

pub fn set_style(&mut self, style: Style)[src]

pub fn make_loading_screen(&mut self, txt: Text) -> Panel[src]

pub fn is_font_loaded(&self, filename: &str) -> bool[src]

Checks if an extra font has previously been loaded with load_font. Returns false for built-in system fonts.

pub fn load_font(&mut self, filename: &str, bytes: Vec<u8>)[src]

Loads an extra font, used only for automatic fallback of missing glyphs.

Trait Implementations

impl AsRef<Assets> for EventCtx<'_>[src]

impl AsRef<Prerender> for EventCtx<'_>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for EventCtx<'a>

impl<'a> !Send for EventCtx<'a>

impl<'a> !Sync for EventCtx<'a>

impl<'a> Unpin for EventCtx<'a>

impl<'a> !UnwindSafe for EventCtx<'a>

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> Downcast for T where
    T: Any

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.