pub struct Scene { /* private fields */ }
Expand description
The main datatype for rendering graphics.
A Scene stores a sequence of drawing commands, their context, and the associated resources, which can later be rendered.
Implementations§
source§impl Scene
impl Scene
sourcepub fn push_layer(
&mut self,
blend: impl Into<BlendMode>,
alpha: f32,
transform: Affine,
clip: &impl Shape
)
pub fn push_layer( &mut self, blend: impl Into<BlendMode>, alpha: f32, transform: Affine, clip: &impl Shape )
Pushes a new layer clipped by the specified shape and composed with previous layers using the specified blend mode.
Every drawing command after this call will be clipped by the shape until the layer is popped.
However, the transforms are not saved or modified by the layer stack.
sourcepub fn fill<'b>(
&mut self,
style: Fill,
transform: Affine,
brush: impl Into<BrushRef<'b>>,
brush_transform: Option<Affine>,
shape: &impl Shape
)
pub fn fill<'b>( &mut self, style: Fill, transform: Affine, brush: impl Into<BrushRef<'b>>, brush_transform: Option<Affine>, shape: &impl Shape )
Fills a shape using the specified style and brush.
sourcepub fn stroke<'b>(
&mut self,
style: &Stroke,
transform: Affine,
brush: impl Into<BrushRef<'b>>,
brush_transform: Option<Affine>,
shape: &impl Shape
)
pub fn stroke<'b>( &mut self, style: &Stroke, transform: Affine, brush: impl Into<BrushRef<'b>>, brush_transform: Option<Affine>, shape: &impl Shape )
Strokes a shape using the specified style and brush.
sourcepub fn draw_image(&mut self, image: &Image, transform: Affine)
pub fn draw_image(&mut self, image: &Image, transform: Affine)
Draws an image at its natural size with the given transform.
sourcepub fn draw_glyphs(&mut self, font: &Font) -> DrawGlyphs<'_>
pub fn draw_glyphs(&mut self, font: &Font) -> DrawGlyphs<'_>
Returns a builder for encoding a glyph run.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl !UnwindSafe for Scene
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