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§
Source§impl Context
impl Context
Sourcepub fn inner(
&mut self,
) -> (&TextureCreator<WindowContext>, &mut Canvas<Window>, &mut EventPump)
pub fn inner( &mut self, ) -> (&TextureCreator<WindowContext>, &mut Canvas<Window>, &mut EventPump)
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 Freeze for Context
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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
Mutably borrows from an owned value. Read more