Struct rich_sdl2_rust::renderer::pen::Pen
source · pub struct Pen<'renderer> { /* private fields */ }
Expand description
A pen controls its color and renders geometries to the renderer.
This will render when be dropped. So you should re-create on every render.
Implementations§
source§impl<'renderer> Pen<'renderer>
impl<'renderer> Pen<'renderer>
sourcepub fn new(renderer: &'renderer Renderer<'_>) -> Self
pub fn new(renderer: &'renderer Renderer<'_>) -> Self
Constructs a pen from the renderer Renderer
.
sourcepub fn blend_mode(&self) -> BlendMode
pub fn blend_mode(&self) -> BlendMode
Returns the current color blend mode.
sourcepub fn set_blend_mode(&self, mode: BlendMode)
pub fn set_blend_mode(&self, mode: BlendMode)
Sets the color blend mode.
sourcepub fn lines(&self, points: impl IntoIterator<Item = Point>)
pub fn lines(&self, points: impl IntoIterator<Item = Point>)
Draws the lines.
sourcepub fn points(&self, points: impl IntoIterator<Item = Point>)
pub fn points(&self, points: impl IntoIterator<Item = Point>)
Draw the points.
sourcepub fn stroke_rect(&self, rect: Rect)
pub fn stroke_rect(&self, rect: Rect)
Draw the rectangle only lines.
sourcepub fn stroke_rects(&self, rects: impl IntoIterator<Item = Rect>)
pub fn stroke_rects(&self, rects: impl IntoIterator<Item = Rect>)
Draw the rectangles only lines.
sourcepub fn fill_rects(&self, rects: impl IntoIterator<Item = Rect>)
pub fn fill_rects(&self, rects: impl IntoIterator<Item = Rect>)
Draw the filled rectangles.
Trait Implementations§
source§impl FontRenderExt for Pen<'_>
impl FontRenderExt for Pen<'_>
Auto Trait Implementations§
impl<'renderer> !RefUnwindSafe for Pen<'renderer>
impl<'renderer> !Send for Pen<'renderer>
impl<'renderer> !Sync for Pen<'renderer>
impl<'renderer> Unpin for Pen<'renderer>
impl<'renderer> !UnwindSafe for Pen<'renderer>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more