pub trait Drawable {
fn draw<P>(&self, ctx: &mut Context, params: P)
where
P: Into<DrawParams>;
}
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§
sourcefn draw<P>(&self, ctx: &mut Context, params: P)where
P: Into<DrawParams>,
fn draw<P>(&self, ctx: &mut Context, params: P)where
P: Into<DrawParams>,
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.