Struct piston_window::line::Line[][src]

pub struct Line {
    pub color: [f32; 4],
    pub radius: f64,
    pub shape: Shape,
}

A colored line with a default border radius

Fields

color: [f32; 4]

The line color

radius: f64

The line radius

shape: Shape

The line shape

Implementations

impl Line[src]

pub fn new(color: [f32; 4], radius: f64) -> Line[src]

Creates a new line

pub fn new_round(color: [f32; 4], radius: f64) -> Line[src]

Creates a new line

pub fn color(self, value: [f32; 4]) -> Line[src]

Sets color.

pub fn radius(self, value: f64) -> Line[src]

Sets radius.

pub fn width(self, value: f64) -> Line[src]

Sets width.

pub fn shape(self, value: Shape) -> Line[src]

Sets shape.

pub fn draw_from_to<P, G>(
    &self,
    from: P,
    to: P,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2],
    g: &mut G
) where
    P: Into<[f64; 2]>,
    G: Graphics
[src]

Draws line using default method between points.

pub fn draw<L, G>(
    &self,
    line: L,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2],
    g: &mut G
) where
    G: Graphics,
    L: Into<[f64; 4]>, 
[src]

Draws line using default method.

pub fn draw_tri<L, G>(
    &self,
    line: L,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2],
    g: &mut G
) where
    G: Graphics,
    L: Into<[f64; 4]>, 
[src]

Draws line using triangulation.

pub fn draw_arrow<L, G>(
    &self,
    line: L,
    head_size: f64,
    draw_state: &DrawState,
    transform: [[f64; 3]; 2],
    g: &mut G
) where
    G: Graphics,
    L: Into<[f64; 4]>, 
[src]

Draws an arrow

Head size is the sides of the triangle between the arrow hooks and the line

Trait Implementations

impl Clone for Line[src]

impl Colored for Line[src]

impl Copy for Line[src]

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

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> Pointable for T[src]

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.