pub enum Primitive {
None,
Group {
primitives: Vec<Primitive, Global>,
},
Text {
content: String,
bounds: Rectangle<f32>,
color: Color,
size: f32,
font: Font,
horizontal_alignment: HorizontalAlignment,
vertical_alignment: VerticalAlignment,
},
Quad {
bounds: Rectangle<f32>,
background: Background,
border_radius: f32,
border_width: f32,
border_color: Color,
},
Image {
handle: Handle,
bounds: Rectangle<f32>,
},
Svg {
handle: Handle,
bounds: Rectangle<f32>,
},
Clip {
bounds: Rectangle<f32>,
offset: Vector<u32>,
content: Box<Primitive, Global>,
},
Translate {
translation: Vector<f32>,
content: Box<Primitive, Global>,
},
Mesh2D {
buffers: Mesh2D,
size: Size<f32>,
},
Cached {
cache: Arc<Primitive>,
},
}
Expand description
A rendering primitive.
Variants
None
An empty primitive
Group
A group of primitives
Text
Fields
content: String
The contents of the text
bounds: Rectangle<f32>
The bounds of the text
color: Color
The color of the text
size: f32
The size of the text
horizontal_alignment: HorizontalAlignment
The horizontal alignment of the text
vertical_alignment: VerticalAlignment
The vertical alignment of the text
A text primitive
Quad
Fields
bounds: Rectangle<f32>
The bounds of the quad
background: Background
The background of the quad
border_radius: f32
The border radius of the quad
border_width: f32
The border width of the quad
border_color: Color
The border color of the quad
A quad primitive
Image
An image primitive
Svg
An SVG primitive
Clip
Fields
bounds: Rectangle<f32>
The bounds of the clip
A clip primitive
Translate
Fields
A primitive that applies a translation
Mesh2D
Fields
buffers: Mesh2D
The vertex and index buffers of the mesh
size: Size<f32>
The size of the drawable region of the mesh.
Any geometry that falls out of this region will be clipped.
A low-level primitive to render a mesh of triangles.
It can be used to render many kinds of geometry freely.
Cached
A cached primitive.
This can be useful if you are implementing a widget where primitive generation is expensive.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.