Struct kansas::Canvas [−][src]
pub struct Canvas { /* fields omitted */ }
Methods
impl Canvas
[src]
impl Canvas
pub fn new() -> Self
[src]
pub fn new() -> Self
create a new Canvas
pub fn on<E: Listener>(&mut self, handler: Callback<E>)
[src]
pub fn on<E: Listener>(&mut self, handler: Callback<E>)
register a function to be used as an event handler
note: as of right now, registering the same event twice will overwrite the previous handler function
pub fn off<E: Listener>(&mut self)
[src]
pub fn off<E: Listener>(&mut self)
pub fn context_mut(&mut self) -> &mut Context
[src]
pub fn context_mut(&mut self) -> &mut Context
get a mutable reference to the canvas's context
pub fn pause(&mut self)
[src]
pub fn pause(&mut self)
hold execution until user hits Esc
Methods from Deref<Target = Context>
pub fn dimensions(&self) -> (u32, u32)
[src]
pub fn dimensions(&self) -> (u32, u32)
dimensions
pub fn fill_color<C>(&mut self, color: C) where
C: CanvasColor,
[src]
pub fn fill_color<C>(&mut self, color: C) where
C: CanvasColor,
set fill color
pub fn fill_rect(&mut self, x: u32, y: u32, width: u32, height: u32)
[src]
pub fn fill_rect(&mut self, x: u32, y: u32, width: u32, height: u32)
fill rectangle with preset fill color
pub fn fill_by<C, F>(&mut self, x: u32, y: u32, width: u32, height: u32, f: F) where
F: Fn(u32, u32) -> C,
C: CanvasColor,
[src]
pub fn fill_by<C, F>(&mut self, x: u32, y: u32, width: u32, height: u32, f: F) where
F: Fn(u32, u32) -> C,
C: CanvasColor,
fill rectangle using a fill function
pub fn set_pixel<C: CanvasColor>(&mut self, x: u32, y: u32, c: C)
[src]
pub fn set_pixel<C: CanvasColor>(&mut self, x: u32, y: u32, c: C)
set a pixel to a specific color
this is a low level texture operation and is not effected by preset colors or alpha blending
Trait Implementations
impl Deref for Canvas
[src]
impl Deref for Canvas
type Target = Context
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl DerefMut for Canvas
[src]
impl DerefMut for Canvas