[][src]Trait crow::DrawTarget

pub trait DrawTarget {
    fn receive_draw(
        &mut self,
        ctx: &mut Context,
        texture: &Texture,
        position: (i32, i32),
        config: &DrawConfig
    ) -> Result<(), ErrDontCare>;
fn receive_clear_color(
        &mut self,
        ctx: &mut Context,
        color: (f32, f32, f32, f32)
    ) -> Result<(), ErrDontCare>;
fn receive_line(
        &mut self,
        ctx: &mut Context,
        from: (i32, i32),
        to: (i32, i32),
        color: (f32, f32, f32, f32)
    ) -> Result<(), ErrDontCare>; }

A trait implemented by types upon which can be drawn.

Required methods

fn receive_draw(
    &mut self,
    ctx: &mut Context,
    texture: &Texture,
    position: (i32, i32),
    config: &DrawConfig
) -> Result<(), ErrDontCare>

Draws the texture onto self.

fn receive_clear_color(
    &mut self,
    ctx: &mut Context,
    color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>

Sets each pixel of self to color.

fn receive_line(
    &mut self,
    ctx: &mut Context,
    from: (i32, i32),
    to: (i32, i32),
    color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>

Draws a line from from to to.

The pixel at to is not part of the line.

Loading content...

Implementations on Foreign Types

impl<'_, T: DrawTarget> DrawTarget for &'_ mut T[src]

Loading content...

Implementors

impl DrawTarget for Texture[src]

fn receive_draw(
    &mut self,
    ctx: &mut Context,
    texture: &Texture,
    position: (i32, i32),
    config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]

Draws the texture onto self. This permanently alters self, in case the original is still required, consider cloning this Texture first.

It is recommended to call Context::draw instead of using this method directly.

impl DrawTarget for WindowSurface[src]

fn receive_draw(
    &mut self,
    ctx: &mut Context,
    texture: &Texture,
    position: (i32, i32),
    config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]

Draws texture to the window, to finish the frame, call Context::finalize_frame.

impl<T: DrawTarget> DrawTarget for Offset<T>[src]

impl<T: DrawTarget> DrawTarget for Scaled<T>[src]

Loading content...