Struct drawille::Turtle [−][src]
pub struct Turtle { pub x: f32, pub y: f32, pub brush: bool, pub use_color: bool, pub brush_color: PixelColor, pub rotation: f32, pub cvs: Canvas, }
Expand description
A ‘turtle’ that can walk around a canvas drawing lines.
Fields
x: f32
y: f32
brush: bool
use_color: bool
brush_color: PixelColor
rotation: f32
cvs: Canvas
Implementations
Create a new Turtle
, starting at the given coordinates.
The turtle starts with its brush down, facing right.
Creates a new Turtle
with the provided Canvas
, starting at the given coordinates.
The turtle starts with its brush down, facing right.
Sets the width of a Turtle
’s Canvas
, and return it for use again.
Sets the height of a Turtle
’s Canvas
, and return it for use again.
Use specific color the the brush.
Remove color from brush.
Teleports the Turtle
to the given coordinates.
Note that this draws a line between the old position and the new one if the Turtle
’s
brush is down.