[][src]Trait tetra::graphics::Drawable

pub trait Drawable {
    fn draw<P>(&self, ctx: &mut Context, params: P)
    where
        P: Into<DrawParams>
; }

Represents a type that can be drawn.

graphics::draw can be used to draw without importing this trait, which is sometimes more convienent.

Required methods

fn draw<P>(&self, ctx: &mut Context, params: P) where
    P: Into<DrawParams>, 

Draws self to the screen (or a canvas, if one is enabled), using the specified parameters.

Any type that implements Into<DrawParams> can be passed into this method. For example, since the majority of the time, you only care about changing the position, a Vec2 can be passed to set the position and leave everything else as the defaults.

Loading content...

Implementors

impl Drawable for Animation[src]

impl Drawable for Canvas[src]

impl Drawable for Text[src]

impl Drawable for Texture[src]

impl Drawable for NineSlice[src]

Loading content...