[][src]Enum pixel_widgets::draw::Primitive

pub enum Primitive<'a> {
    PushClip(Rectangle),
    PopClip,
    LayerUp,
    LayerDown,
    DrawRect(RectangleColor),
    DrawText(Text<'a>, Rectangle),
    Draw9(PatchRectangleColor),
    DrawImage(ImageRectangleColor),
}

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 PushClips 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(RectangleColor)

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(PatchRectangleColor)

Draw a 9 patch spanning the bounds of a rectangle, multiplied by a color.

DrawImage(ImageRectangleColor)

Draw an image stretched to the bounds of a rectangle, multiplied by a color.

Trait Implementations

impl<'a> Clone for Primitive<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Primitive<'a>[src]

impl<'a> Send for Primitive<'a>[src]

impl<'a> Sync for Primitive<'a>[src]

impl<'a> Unpin for Primitive<'a>[src]

impl<'a> UnwindSafe for Primitive<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.