Enum conrod::render::PrimitiveKind
[−]
[src]
pub enum PrimitiveKind<'a> {
Rectangle {
color: Color,
},
Polygon {
color: Color,
points: &'a [Point],
},
Lines {
color: Color,
cap: Cap,
thickness: Scalar,
points: &'a [Point],
},
Image {
color: Option<Color>,
source_rect: Option<Rect>,
},
Text {
color: Color,
text: Text<'a>,
font_id: Id,
},
Other(&'a Container),
}The unique kind for each primitive element in the Ui.
Variants
RectangleA filled Rectangle.
These are produced by the Rectangle and BorderedRectangle primitive widgets. A Filled
Rectangle widget produces a single Rectangle. The BorderedRectangle produces two
Rectangles, the first for the outer border and the second for the inner on top.
Fields of Rectangle
color: Color | The fill colour for the rectangle. |
PolygonA filled Polygon.
These are produced by the Oval and Polygon primitive widgets.
Fields of Polygon
color: Color | The fill colour for the inner part of the polygon |
points: &'a [Point] | The ordered points that, when joined with lines, represent each side of the The first and final points should always be the same. |
LinesA series of consecutive Lines.
These are produces via the Line and PointPath primitive widgets, or the shape
primitives if they are instantiated with an Outline style.
Fields of Lines
color: Color | The colour of each |
cap: Cap | Whether the end of the lines should be |
thickness: Scalar | The thickness of the lines, i.e. the width of a vertical line or th height of a horizontal line. |
points: &'a [Point] | The ordered points which should be joined by lines. |
ImageA single Image, produced by the primitive Image widget.
Fields of Image
color: Option<Color> | When |
source_rect: Option<Rect> | The area of the texture that will be drawn to the |
TextA single block of Text, produced by the primitive Text widget.
Fields of Text
color: Color | The colour of the |
text: Text<'a> | All glyphs within the |
font_id: Id | The unique identifier for the font, useful for the |
Other(&'a Container)An Other variant will be yielded for every non-primitive widget in the list.
Most of the time, this variant can be ignored, however it is useful for users who need to
render widgets in ways that cannot be covered by the other PrimitiveKind variants.
For example, a Shader widget might be required for updating uniforms in user rendering
code. In order to access the unique state of this widget, the user can check Other
variants for a container whose kind field matches the unique kind of the Shader widget.
They can then retrieve the unique state of the widget and cast it to its actual type using
either of the Container::state_and_style or Container::unique_widget_state methods.