pub struct Shell {
pub mode: Mode,
pub mouse: Mouse,
pub want_exit: bool,
/* private fields */
}Fields§
§mode: Mode§mouse: Mouse§want_exit: boolImplementations§
Source§impl Shell
impl Shell
pub fn new(audio: AudioHandle, sdk_path: PathBuf) -> Self
Sourcepub fn set_hide_cursor(&mut self, hide: bool)
pub fn set_hide_cursor(&mut self, hide: bool)
Hide the console’s software mouse cursor (used by frontends that show the host’s own pointer, like the terminal, to avoid a double cursor).
pub fn assets(&self) -> Option<&Assets>
pub fn assets_mut(&mut self) -> Option<&mut Assets>
Sourcepub fn window_title(&self) -> String
pub fn window_title(&self) -> String
The OS window title: the loaded cart’s name plus the console name, or just the console name when nothing is loaded.
Feed a game button (host already mapped keys to buttons 0..6).
pub fn key(&mut self, key: Key, mods: Mods)
pub fn switch_editor(&mut self, mode: Mode)
Sourcepub fn startup_load(&mut self, path: &str)
pub fn startup_load(&mut self, path: &str)
Load a cart/project given on the command line at boot.
Sourcepub fn startup_run(&mut self)
pub fn startup_run(&mut self)
Run the cart/project loaded at boot, as if the user typed run. Used by
the pixel8 run <path> launch mode. A cart enters Run mode immediately; a
project spawns its build and enters Run mode once it succeeds.
pub fn cmd_run(&mut self)
Sourcepub fn tick_fps(&self) -> u32
pub fn tick_fps(&self) -> u32
The rate the host should tick at: a running cart’s frame rate (30 or 60), else 30. Running the whole Run-mode tick at the cart’s rate is what gets the display to refresh at 60 too.
pub fn tick(&mut self)
pub fn draw(&mut self) -> &Framebuffer
Auto Trait Implementations§
impl !RefUnwindSafe for Shell
impl !Sync for Shell
impl !UnwindSafe for Shell
impl Freeze for Shell
impl Send for Shell
impl Unpin for Shell
impl UnsafeUnpin for Shell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.