Struct classicube_sys::screen::OwnedScreen

source ·
pub struct OwnedScreen {
    pub screen: Box<Screen>,
    /* private fields */
}

Fields§

§screen: Box<Screen>

Implementations§

source§

impl OwnedScreen

source

pub fn new() -> Self

source

pub fn add<T: Into<Priority>>(&mut self, priority: T)

source

pub fn remove(&mut self)

source

pub fn on_init( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Initialises persistent state.

source

pub fn on_update( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, delta: f32), ) -> &mut Self

Updates this screen, called every frame just before Render().

source

pub fn on_free( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Frees/releases persistent state.

source

pub fn on_render( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, delta: f32), ) -> &mut Self

Draws this screen and its widgets on screen.

source

pub fn on_build_mesh( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Builds the vertex mesh for all the widgets in the screen.

source

pub fn on_handles_input_down( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, key: c_int, device: *mut InputDevice) -> c_int, ) -> &mut Self

Returns non-zero if an input press is handled.

source

pub fn on_on_input_up( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, key: c_int, device: *mut InputDevice), ) -> &mut Self

Returns non-zero if an input release is handled.

source

pub fn on_handles_key_press( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, keyChar: c_char) -> c_int, ) -> &mut Self

Returns non-zero if a key character press is handled.

source

pub fn on_handles_text_changed( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, str: *const cc_string) -> c_int, ) -> &mut Self

Returns non-zero if a key character press is handled. Currently only raised by on-screen keyboard in web client.

source

pub fn on_handles_pointer_down( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, id: c_int, x: c_int, y: c_int) -> c_int, ) -> &mut Self

Returns non-zero if a pointer press is handled.

source

pub fn on_on_pointer_up( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, id: c_int, x: c_int, y: c_int), ) -> &mut Self

Returns non-zero if a pointer release is handled.

source

pub fn on_handles_pointer_move( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, id: c_int, x: c_int, y: c_int) -> c_int, ) -> &mut Self

Returns non-zero if a pointer movement is handled.

source

pub fn on_handles_mouse_scroll( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, delta: f32) -> c_int, ) -> &mut Self

Returns non-zero if a mouse wheel scroll is handled.

source

pub fn on_layout( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Positions widgets on screen. Typically called on window resize.

source

pub fn on_context_lost( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Destroys graphics resources. (textures, vertex buffers, etc)

source

pub fn on_context_recreated( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self

Allocates graphics resources. (textures, vertex buffers, etc)

source

pub fn on_handles_pad_axis( &mut self, f: unsafe extern "C" fn(elem: *mut c_void, axis: c_int, x: f32, y: f32) -> c_int, ) -> &mut Self

Returns non-zero if a pad axis update is handled.

Trait Implementations§

source§

impl Default for OwnedScreen

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for OwnedScreen

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> TryFrom<U> for T
where 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 T
where 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.