pub struct Context { /* private fields */ }Expand description
Game context.
In most cases, this should never actually be used; instead, just pass it around to the various cat-box functions such as Sprite::draw().
Implementations
sourceimpl Context
impl Context
sourcepub fn inner(&mut self) -> (&TextureCreator<WindowContext>, &mut Canvas<Window>)
pub fn inner(&mut self) -> (&TextureCreator<WindowContext>, &mut Canvas<Window>)
Get the inner Canvas and TextureCreator.
Only use this method if you know what you’re doing.
sourcepub fn set_background_colour(&mut self, r: u8, g: u8, b: u8)
pub fn set_background_colour(&mut self, r: u8, g: u8, b: u8)
Set the background colour. See Canvas::set_draw_color() for more info.
Auto Trait Implementations
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more