Trait ggez::graphics::Drawable[][src]

pub trait Drawable {
    fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> GameResult<()>;
fn set_blend_mode(&mut self, mode: Option<BlendMode>);
fn get_blend_mode(&self) -> Option<BlendMode>; fn draw(
        ctx: &mut Context,
        dest: Point2,
        rotation: f32
    ) -> GameResult<()> { ... } }

All types that can be drawn on the screen implement the Drawable trait.

Required Methods

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.

Sets the blend mode to be used when drawing this drawable. This overrides the general graphics::set_blend_mode(). If None is set, defers to the blend mode set by graphics::set_blend_mode().

Gets the blend mode to be used when drawing this drawable.

Provided Methods

Draws the drawable onto the rendering target.

It just is a shortcut that calls draw_ex() with a default DrawParam except for the destination and rotation.

  • ctx - The Context this graphic will be rendered to.
  • dest - the position to draw the graphic expressed as a Point2.
  • rotation - orientation of the graphic in radians.