[−][src]Trait crow::DrawTarget
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>
&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>
&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>
&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.
Implementations on Foreign Types
impl<'_, T: DrawTarget> DrawTarget for &'_ mut T
[src]
fn receive_draw(
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]
&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>
[src]
&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>
[src]
&mut self,
ctx: &mut Context,
from: (i32, i32),
to: (i32, i32),
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
Implementors
impl DrawTarget for Texture
[src]
fn receive_draw(
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
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.
fn receive_clear_color(
&mut self,
ctx: &mut Context,
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
[src]
&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>
[src]
&mut self,
ctx: &mut Context,
from: (i32, i32),
to: (i32, i32),
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
impl DrawTarget for WindowSurface
[src]
fn receive_draw(
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
Draws texture
to the window, to finish the frame, call Context::finalize_frame
.
fn receive_clear_color(
&mut self,
ctx: &mut Context,
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
[src]
&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>
[src]
&mut self,
ctx: &mut Context,
from: (i32, i32),
to: (i32, i32),
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
impl<T: DrawTarget> DrawTarget for Offset<T>
[src]
fn receive_draw(
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]
&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>
[src]
&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>
[src]
&mut self,
ctx: &mut Context,
from: (i32, i32),
to: (i32, i32),
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>
impl<T: DrawTarget> DrawTarget for Scaled<T>
[src]
fn receive_draw(
&mut self,
ctx: &mut Context,
texture: &Texture,
position: (i32, i32),
config: &DrawConfig
) -> Result<(), ErrDontCare>
[src]
&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>
[src]
&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>
[src]
&mut self,
ctx: &mut Context,
from: (i32, i32),
to: (i32, i32),
color: (f32, f32, f32, f32)
) -> Result<(), ErrDontCare>