Trait tetra::graphics::Drawable

source ·
pub trait Drawable {
    fn draw<T: Into<DrawParams>>(&self, ctx: &mut Context, params: T);
}
Expand description

Represents a type that can be drawn to the screen/render target.

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

Required Methods§

Draws self to the currently enabled render target, 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.

Implementors§