pub struct Painter<'a> { /* private fields */ }Implementations§
Source§impl<'a> Painter<'a>
impl<'a> Painter<'a>
pub fn clear(&mut self, color: [f32; 4])
Sourcepub fn visible_rect(&self) -> ([f32; 2], [f32; 2])
pub fn visible_rect(&self) -> ([f32; 2], [f32; 2])
World-space rectangle currently visible through the 2D camera, as (min, max).
pub fn sprite(&mut self, tex: TextureId, pos: [f32; 2], size: [f32; 2])
pub fn sprite_ex( &mut self, tex: TextureId, inst: SpriteInstance, layer: i16, blend: BlendMode, )
Sourcepub fn rect(&mut self, pos: [f32; 2], size: [f32; 2], color: [f32; 4])
pub fn rect(&mut self, pos: [f32; 2], size: [f32; 2], color: [f32; 4])
Filled rectangle (uses the internal 1×1 white texture).
Sourcepub fn rect_outline(
&mut self,
pos: [f32; 2],
size: [f32; 2],
thickness: f32,
color: [f32; 4],
)
pub fn rect_outline( &mut self, pos: [f32; 2], size: [f32; 2], thickness: f32, color: [f32; 4], )
4 thin lines around the rectangle.
Sourcepub fn line(
&mut self,
a: [f32; 2],
b: [f32; 2],
thickness: f32,
color: [f32; 4],
)
pub fn line( &mut self, a: [f32; 2], b: [f32; 2], thickness: f32, color: [f32; 4], )
Line segment, drawn as a rotated thin quad through the sprite batcher.
Sourcepub fn circle(&mut self, center: [f32; 2], radius: f32, color: [f32; 4])
pub fn circle(&mut self, center: [f32; 2], radius: f32, color: [f32; 4])
Filled disk (layer 0).
Sourcepub fn circle_outline(
&mut self,
center: [f32; 2],
radius: f32,
thickness: f32,
color: [f32; 4],
)
pub fn circle_outline( &mut self, center: [f32; 2], radius: f32, thickness: f32, color: [f32; 4], )
Ring (outline circle) with the given pixel thickness (layer 0).
Sourcepub fn circle_ex(
&mut self,
center: [f32; 2],
radius: f32,
thickness: f32,
color: [f32; 4],
layer: i16,
)
pub fn circle_ex( &mut self, center: [f32; 2], radius: f32, thickness: f32, color: [f32; 4], layer: i16, )
Circle on an explicit layer. thickness == 0.0 is a filled disk; > 0.0 is a ring of
that pixel thickness. Lower layers draw under higher ones across all batchers.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Painter<'a>
impl<'a> !RefUnwindSafe for Painter<'a>
impl<'a> Send for Painter<'a>
impl<'a> Sync for Painter<'a>
impl<'a> Unpin for Painter<'a>
impl<'a> UnsafeUnpin for Painter<'a>
impl<'a> !UnwindSafe for Painter<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.