[][src]Struct kiss3d_conrod::widget::primitive::shape::polygon::Polygon

pub struct Polygon<I> {
    pub common: CommonBuilder,
    pub points: I,
    pub style: Style,
    pub maybe_shift_to_centre_from: Option<Point>,
}

A basic, non-interactive, arbitrary Polygon widget.

The Polygon is described by specifying its corners in order.

Polygon will automatically close all shapes, so the given list of points does not need to start and end with the same position.

Fields

common: CommonBuilder

Data necessary and common for all widget builder types.

points: I

The points describing the corners of the Polygon.

style: Style

Unique styling for the Polygon.

maybe_shift_to_centre_from: Option<Point>

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

Methods

impl<I> Polygon<I>[src]

pub fn styled(points: I, style: Style) -> Self[src]

Build a polygon with the given points and style.

pub fn fill(points: I) -> Self[src]

Build a Polygon with the default Fill style.

pub fn fill_with(points: I, color: Color) -> Self[src]

Build a Polygon Filled with the given Color.

pub fn outline(points: I) -> Self[src]

Build a Polygon with the default Outline style.

pub fn outline_styled(points: I, style: Style) -> Self[src]

Build a Polygon Outlineed with the given line style.

pub fn abs_styled(points: I, style: Style) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

Build a new filled Polygon whose bounding box is fit to the absolute co-ordinates of the points.

This requires that the points iterator is Clone so that we may iterate through and determine the bounding box of the points.

If you would rather centre the points to the middle of the bounding box, use the Polygon::centred methods instead.

pub fn abs_fill(points: I) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::abs_styled but builds the Polygon with the default Fill style.

pub fn abs_fill_with(points: I, color: Color) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::abs_styled but builds the Polygon Filled with the given Color.

pub fn abs_outline(points: I) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::abs_styled but builds the Polygon with the default Outline style.

pub fn abs_outline_styled(points: I, style: Style) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::abs_styled but builds the Polygon with the given Outline styling.

pub fn centred_styled(points: I, style: Style) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

Build a new Polygon and shift the location of the points so that the centre of their bounding rectangle lies at the position determined for the Polygon widget.

This is useful if your points simply describe a shape and you want to position them using conrod's auto-layout and/or Positionable methods.

If you would rather centre the bounding box to the points, use the Polygon::abs constructor method instead.

pub fn centred_fill(points: I) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::centred_styled but constructs the Polygon with the default Fill style.

pub fn centred_fill_with(points: I, color: Color) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::centred_styled but constructs the Polygon Filled with the given color.

pub fn centred_outline(points: I) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::centred_styled but constructs the Polygon with the default Outline style.

pub fn centred_outline_styled(points: I, style: Style) -> Self where
    I: IntoIterator<Item = Point> + Clone
[src]

The same as Polygon::centred_styled but constructs the Polygon Outlined with the given styling.

Trait Implementations

impl<I> Colorable for Polygon<I>[src]

impl<I> Common for Polygon<I>[src]

impl<I> Widget for Polygon<I> where
    I: IntoIterator<Item = Point>, 
[src]

type State = State

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

type Style = Style

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

fn update(self, args: UpdateArgs<Self>) -> Self::Event[src]

Update the state of the Polygon.

impl<I: Clone> Clone for Polygon<I>[src]

impl<I: Copy> Copy for Polygon<I>[src]

impl<I: Debug> Debug for Polygon<I>[src]

Auto Trait Implementations

impl<I> Send for Polygon<I> where
    I: Send

impl<I> Sync for Polygon<I> where
    I: Sync

impl<I> Unpin for Polygon<I> where
    I: Unpin

impl<I> UnwindSafe for Polygon<I> where
    I: UnwindSafe

impl<I> RefUnwindSafe for Polygon<I> where
    I: RefUnwindSafe

Blanket Implementations

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

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

fn get_x_dimension(&Self, &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.

fn get_y_dimension(&Self, &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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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.

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

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

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