pub struct YakuiMiniQuad { /* private fields */ }

Implementations§

source§

impl YakuiMiniQuad

source

pub fn new(ctx: &mut GraphicsContext) -> YakuiMiniQuad

source

pub fn has_input_focus(&self) -> bool

Returns true if the last mouse or keyboard event was sunk by yakui, and should not be handled by your game.

source

pub fn has_keyboard_focus(&self) -> bool

Returns true if the last keyboard event was sunk by yakui, and should not be handled by your game.

source

pub fn has_mouse_focus(&self) -> bool

Returns true if the last mouse event was sunk by yakui, and should not be handled by your game.

source

pub fn ctx(&mut self) -> &mut Yakui

Returns a reference to the internal Yakui context.

source

pub fn start(&mut self, ctx: &mut Context)

Updates the viewport size and calls start on the internal yakui context, binding it to the current thread.

source

pub fn finish(&mut self)

Calls finish on the internal yakui context, preparing the context for rendering.

source

pub fn run<F>(&mut self, ctx: &mut Context, ui_update_function: F)where F: FnOnce(&mut Yakui),

Wraps calling start and finish, where start will now be called before your closure is invoked and finish will be invoked after.

source

pub fn draw(&mut self, ctx: &mut GraphicsContext)

Renders the queued ui draw commands.

Trait Implementations§

source§

impl EventHandler for YakuiMiniQuad

source§

fn mouse_motion_event(&mut self, _ctx: &mut Context, x: f32, y: f32)

source§

fn mouse_button_down_event( &mut self, _ctx: &mut Context, button: MouseButton, _x: f32, _y: f32 )

source§

fn mouse_button_up_event( &mut self, _ctx: &mut Context, button: MouseButton, _x: f32, _y: f32 )

source§

fn key_down_event( &mut self, _ctx: &mut Context, keycode: KeyCode, _keymods: KeyMods, _repeat: bool )

source§

fn key_up_event( &mut self, _ctx: &mut Context, keycode: KeyCode, _keymods: KeyMods )

source§

fn mouse_wheel_event(&mut self, _ctx: &mut Context, x: f32, y: f32)

source§

fn char_event( &mut self, _ctx: &mut Context, character: char, _keymods: KeyMods, _repeat: bool )

source§

fn resize_event(&mut self, _ctx: &mut Context, width: f32, height: f32)

source§

fn update(&mut self, ctx: &mut Context)

On most platforms update() and draw() are called each frame, sequentially, draw right after update. But on Android (and maybe some other platforms in the future) update might be called without draw. When the app is in background, Android destroys the rendering surface, while app is still alive and can do some usefull calculations. Note that in this case drawing from update may lead to crashes.
source§

fn draw(&mut self, ctx: &mut Context)

source§

fn touch_event( &mut self, ctx: &mut GraphicsContext, phase: TouchPhase, _id: u64, x: f32, y: f32 )

Default implementation emulates mouse clicks
source§

fn raw_mouse_motion(&mut self, _ctx: &mut GraphicsContext, _dx: f32, _dy: f32)

Represents raw hardware mouse motion event Note that these events are delivered regardless of input focus and not in pixels, but in hardware units instead. And those units may be different from pixels depending on the target platform
source§

fn window_minimized_event(&mut self, _ctx: &mut GraphicsContext)

Window has been minimized Right now is only implemented on Android, and is called on a Pause ndk callback
source§

fn window_restored_event(&mut self, _ctx: &mut GraphicsContext)

Window has been restored Right now is only implemented on Android, and is called on a Resume ndk callback
source§

fn quit_requested_event(&mut self, _ctx: &mut GraphicsContext)

This event is sent when the userclicks the window’s close button or application code calls the ctx.request_quit() function. The event handler callback code can handle this event by calling ctx.cancel_quit() to cancel the quit. If the event is ignored, the application will quit as usual.
source§

fn files_dropped_event(&mut self, _ctx: &mut GraphicsContext)

A file has been dropped over the application. Applications can request the number of dropped files with ctx.dropped_file_count(), path of an individual file with ctx.dropped_file_path(), and for wasm targets the file bytes can be requested with ctx.dropped_file_bytes().

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> IntoColor<U> for Twhere U: FromColor<T>,

source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,

source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,

source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
§

impl<T> Any for Twhere T: Any,