Struct classicube_sys::screen::OwnedScreen
source · pub struct OwnedScreen {
pub screen: Box<Screen>,
/* private fields */
}
Fields§
§screen: Box<Screen>
Implementations§
source§impl OwnedScreen
impl OwnedScreen
pub fn new() -> Self
pub fn add<T: Into<Priority>>(&mut self, priority: T)
pub fn remove(&mut self)
sourcepub fn on_init(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void),
) -> &mut Self
pub fn on_init( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self
Initialises persistent state.
sourcepub fn on_update(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, delta: f32),
) -> &mut Self
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().
sourcepub fn on_free(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void),
) -> &mut Self
pub fn on_free( &mut self, f: unsafe extern "C" fn(elem: *mut c_void), ) -> &mut Self
Frees/releases persistent state.
sourcepub fn on_render(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, delta: f32),
) -> &mut Self
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.
sourcepub fn on_build_mesh(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void),
) -> &mut Self
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.
sourcepub 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
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.
sourcepub fn on_on_input_up(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, key: c_int, device: *mut InputDevice),
) -> &mut Self
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.
sourcepub fn on_handles_key_press(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, keyChar: c_char) -> c_int,
) -> &mut Self
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.
sourcepub fn on_handles_text_changed(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, str: *const cc_string) -> c_int,
) -> &mut Self
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.
sourcepub 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
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.
sourcepub 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
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.
sourcepub 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
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.
sourcepub fn on_handles_mouse_scroll(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void, delta: f32) -> c_int,
) -> &mut Self
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.
sourcepub fn on_layout(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void),
) -> &mut Self
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.
sourcepub fn on_context_lost(
&mut self,
f: unsafe extern "C" fn(elem: *mut c_void),
) -> &mut Self
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)