[−]Struct piston_window::line::Line
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
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_from_to<P, G>(
&self,
from: P,
to: P,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
) where
G: Graphics,
P: Into<[f64; 2]>,
&self,
from: P,
to: P,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
) where
G: Graphics,
P: Into<[f64; 2]>,
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]>,
&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]>,
&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]>,
&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 Clone for Line
fn clone(&self) -> Line
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Colored for Line
fn mul_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Line
fn hue_rad(self, angle: f32) -> Line
fn tint(self, f: f32) -> Self
fn shade(self, f: f32) -> Self
fn hue_deg(self, angle: f32) -> Self
impl Copy for Line
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,