Trait ggez::graphics::Drawable
[−]
[src]
pub trait Drawable { fn draw_ex(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>,
angle: f64,
center: Option<Point>,
flip_horizontal: bool,
flip_vertical: bool)
-> GameResult<()>; fn draw(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>)
-> GameResult<()> { ... } }
All types that can be drawn on the screen implement the Drawable
trait.
Required Methods
fn draw_ex(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>,
angle: f64,
center: Option<Point>,
flip_horizontal: bool,
flip_vertical: bool)
-> GameResult<()>
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>,
angle: f64,
center: Option<Point>,
flip_horizontal: bool,
flip_vertical: bool)
-> GameResult<()>
Actually draws the object to the screen. This is the most general version of the operation, which is all that is required for implementing this trait. (It also maps nicely onto SDL2's Renderer::copy_ex(), we might want to wrap the types up a bit more nicely someday.)
Provided Methods
fn draw(&mut self,
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>)
-> GameResult<()>
context: &mut Context,
src: Option<Rect>,
dst: Option<Rect>)
-> GameResult<()>
Draws the drawable onto the rendering target.