[][src]Struct uni_app::sys::App

pub struct App {
    pub events: Rc<RefCell<Vec<AppEvent>>>,
    // some fields omitted
}

the main application struct

Fields

events: Rc<RefCell<Vec<AppEvent>>>

Methods

impl App[src]

pub fn new(config: AppConfig) -> App[src]

create a new game window

pub fn get_params() -> Vec<String>[src]

return the command line / URL parameters

pub fn set_fullscreen(&self, b: bool)[src]

activate or deactivate fullscreen. only works on native target

pub fn print<T: Into<String>>(msg: T)[src]

print a message on standard output (native) or js console (web)

pub fn exit()[src]

exit current process (close the game window). On web target, this does nothing.

pub fn hidpi_factor(&self) -> f32[src]

returns the HiDPI factor for current screen

pub fn canvas<'p>(&'p self) -> Box<dyn FnMut(&str) -> *const c_void + 'p>[src]

return the opengl context for this window

pub fn poll_events<F>(&mut self, callback: F) -> bool where
    F: FnOnce(&mut Self), 
[src]

pub fn run<'a, F>(self, callback: F) where
    F: FnMut(&mut Self), 
[src]

start the game loop, calling provided callback every frame

Auto Trait Implementations

impl !Send for App

impl !Sync for App

impl Unpin for App

impl !UnwindSafe for App

impl !RefUnwindSafe for App

Blanket Implementations

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

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

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

type Error = !

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<T> Downcast for T where
    T: Any