Struct nannou::ui::widget::Triangles[][src]

pub struct Triangles<S, I> {
    pub common: CommonBuilder,
    pub style: S,
    pub triangles: I,
    pub maybe_shift_to_centre_from: Option<[f64; 2]>,
}

A widget that allows for drawing a list of triangles.

Fields

common: CommonBuilder

Data necessary and common for all widget builder types.

style: S

Unique styling for the Triangles.

triangles: I

All the point in the triangle list.

maybe_shift_to_centre_from: Option<[f64; 2]>

Whether or not the triangles should be automatically centred to the widget position.

Implementations

impl<I> Triangles<SingleColor, I> where
    I: IntoIterator<Item = Triangle<<SingleColor as Style>::Vertex>>, 
[src]

pub fn single_color<C>(
    color: C,
    points: I
) -> TrianglesUnpositioned<SingleColor, I> where
    C: Into<Rgba>, 
[src]

A list of triangles described by the given points.

All triangles are colored with the given Color.

impl<I> Triangles<MultiColor, I> where
    I: IntoIterator<Item = Triangle<<MultiColor as Style>::Vertex>>, 
[src]

pub fn multi_color(points: I) -> TrianglesUnpositioned<MultiColor, I>[src]

A list of triangles described by the given points.

Every vertex specifies its own unique color.

Trait Implementations

impl<S, I> Clone for Triangles<S, I> where
    S: Clone,
    I: Clone
[src]

impl<S, I> Common for Triangles<S, I>[src]

impl<S, I> Copy for Triangles<S, I> where
    S: Copy,
    I: Copy
[src]

impl<S, I> Debug for Triangles<S, I> where
    S: Debug,
    I: Debug
[src]

impl<S, I> Widget for Triangles<S, I> where
    S: Style,
    I: IntoIterator<Item = Triangle<<S as Style>::Vertex>>, 
[src]

type State = State<Vec<Triangle<<S as Style>::Vertex>, Global>>

State to be stored within the Uis widget cache. Read more

type Style = S

Every widget is required to have its own associated Style type. This type is intended to contain high-level styling information for the widget that can be optionally specified by a user of the widget. Read more

type Event = ()

The type of event yielded by the widget, returned via the Widget::set function. Read more

Auto Trait Implementations

impl<S, I> RefUnwindSafe for Triangles<S, I> where
    I: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, I> Send for Triangles<S, I> where
    I: Send,
    S: Send

impl<S, I> Sync for Triangles<S, I> where
    I: Sync,
    S: Sync

impl<S, I> Unpin for Triangles<S, I> where
    I: Unpin,
    S: Unpin

impl<S, I> UnwindSafe for Triangles<S, I> where
    I: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> Downcast<T> for T

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<W> Positionable for W where
    W: Widget
[src]

impl<T> SetParameter for T

impl<W> Sizeable for W where
    W: Widget
[src]

pub fn get_x_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the x Dimension for the widget via the following:

  • Check for specified value at maybe_x_dimension
  • Otherwise, use the default returned by Widget::default_x_dimension.

pub fn get_y_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the y Dimension for the widget via the following:

  • Check for specified value at maybe_y_dimension
  • Otherwise, use the default returned by Widget::default_y_dimension.

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.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,