Struct gate::AppContext[][src]

pub struct AppContext<A: AppAssetId> {
    pub audio: Audio<A>,
    // some fields omitted
}

Context passed to methods in App.

Fields

Audio playback.

Methods

impl<A: AppAssetId> AppContext<A>
[src]

Returns the app (width, height), which are restricted by the min/max dimensions specified in AppInfo.

Returns the mouse cursor (x, y) position in app coordinates.

The x coordinate lies in the range 0 to self.dims().0. The y coordinate lies in the range 0 to self.dims().1.

Returns the width of a native pixel, measured in "app pixels".

This value will always be at most 1.

Convenience method for aligning an (x, y) position to the nearest native pixel boundaries.

This is typically used to align a camera position. See also self.native_px().

Closes the app entirely.

When compiling to wasm32-unknown-unknown, the app may be resumed after it is closed via invoking a JavaScript method.

Auto Trait Implementations

impl<A> !Send for AppContext<A>

impl<A> !Sync for AppContext<A>