[][src]Enum sixtyfps_corelib::graphics::RenderingVariable

#[repr(C)]pub enum RenderingVariable {
    Translate(f32f32),
    Color(Color),
    ScaledWidth(f32),
    ScaledHeight(f32),
    TextCursor(f32f32f32),
    TextSelection(f32f32f32),
}

This enum is used to affect various aspects of the rendering of GraphicsBackend::LowLevelRenderingPrimitive without the need to re-create them. See the documentation of HighLevelRenderingPrimitive about which variables are supported in which order.

Variants

Translate(f32f32)

Translates the primitive by the given (x, y) vector.

Color(Color)

Apply the specified color. Depending on the order in the rendering variables array this may apply to different aspects of the primitive, such as the fill or stroke.

ScaledWidth(f32)

Scale the primitive by the specified width.

ScaledHeight(f32)

Scale the primitive by the specified height.

TextCursor(f32f32f32)

Draw a text cursor. The parameters provide the x coordiante and the width/height as (x, width, height) tuple.

TextSelection(f32f32f32)

Draw a text selection. The parameters provide the starting x coordinate, the width and the height. This variable must be followed by two colors, foreground and background.

Implementations

impl RenderingVariable[src]

pub fn as_color(&self) -> &Color[src]

Returns the color of this variable, or panics if the enum holds a different variant.

pub fn as_scaled_width(&self) -> f32[src]

Returns the scaled width of this variable, or panics if the enum holds a different variant.

pub fn as_scaled_height(&self) -> f32[src]

Returns the scaled height of this variable, or panics if the enum holds a different variant.

Trait Implementations

impl Clone for RenderingVariable[src]

impl Debug for RenderingVariable[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.