[]Struct piston_window::line::Line

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

Methods

impl Line

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

Creates a new line

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

Creates a new line

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

Sets color.

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

Sets radius.

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

Sets width.

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

Sets shape.

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]>, 

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]>, 

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]>, 

Draws an arrow

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

Trait Implementations

impl Copy for Line

impl Colored for Line

fn tint(self, f: f32) -> Self

Mixes the current color with white. Read more

fn shade(self, f: f32) -> Self

Mixes the current color with black. Read more

fn hue_deg(self, angle: f32) -> Self

Rotates hue by degrees.

impl Clone for Line

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Line

impl Sync for Line

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Erased for T