pub enum Primitive<'a> {
PushClip(Rectangle),
PopClip,
LayerUp,
LayerDown,
DrawRect(Rectangle, Color),
DrawText(Text<'a>, Rectangle),
Draw9(Patch, Rectangle, Color),
DrawImage(ImageData, Rectangle, Color),
}
Expand description
A high level primitive that can be drawn without any further data.
Variants§
PushClip(Rectangle)
Pushes a clipping rectangle on a clipping rectangle stack. The topmost clipping rectangle is used by the renderer. When a clipping rectangle is active, only pixels inside of the rectangle are actually drawn to the screen. This is useful for scrolling like behaviour.
PopClip
Pops a clipping rectangle from a clipping rectangle stack. All PushClip
s should have
a matching PopClip
.
LayerUp
Move following commands one layer up. Higher layers always draw in front of lower layers.
LayerDown
Move following commands one layer down. Higher layers always draw in front of lower layers.
DrawRect(Rectangle, Color)
Draw a rectangle filled with a color.
DrawText(Text<'a>, Rectangle)
Draw some text within the bounds of a rectangle.
See Text
for more information.
Draw9(Patch, Rectangle, Color)
Draw a 9 patch spanning the bounds of a rectangle, multiplied by a color.
DrawImage(ImageData, Rectangle, Color)
Draw an image stretched to the bounds of a rectangle, multiplied by a color.