Trait ggez::graphics::Drawable
[−]
[src]
pub trait Drawable { fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> GameResult<()>; fn draw(
&self,
ctx: &mut Context,
dest: Point,
rotation: f32
) -> GameResult<()> { ... } }
All types that can be drawn on the screen implement the Drawable
trait.
Required Methods
fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> 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.
Provided Methods
fn draw(&self, ctx: &mut Context, dest: Point, rotation: f32) -> GameResult<()>
Draws the drawable onto the rendering target.
It just is a shortcut that calls draw_ex()
with some sane defaults.
ctx
- TheContext
this graphic will be rendered to.dest
- the position to draw the graphic expressed as aPoint
.rotation
- orientation of the graphic in radians.