Struct buffer_graphics_lib::prelude::Triangle
source · pub struct Triangle { /* private fields */ }
Implementations§
source§impl Triangle
impl Triangle
pub fn angles(&self) -> [isize; 3]
pub fn angle_type(&self) -> &TriangleAngleType
pub fn side_type(&self) -> &TriangleSideType
source§impl Triangle
impl Triangle
pub fn as_rect(&self) -> Rect
pub fn right_angle<P>( angle_coord: P, width: usize, height: usize, angle_position: AnglePosition ) -> Trianglewhere P: Into<Coord>,
sourcepub fn equilateral<P>(center: P, size: usize, flat_side: FlatSide) -> Trianglewhere
P: Into<Coord>,
pub fn equilateral<P>(center: P, size: usize, flat_side: FlatSide) -> Trianglewhere P: Into<Coord>,
Create an equilateral triangle with width and height of [size] around [center] The top left would be (center.x - size / 2, center.y + size / 2) and bottom right (center.x + size / 2, center.y + size / 2)
Trait Implementations§
source§impl FromDrawable<Triangle> for ShapeBox
impl FromDrawable<Triangle> for ShapeBox
source§impl PartialEq<Triangle> for Triangle
impl PartialEq<Triangle> for Triangle
source§impl Shape for Triangle
impl Shape for Triangle
source§fn from_points(points: &[Coord]) -> Trianglewhere
Triangle: Sized,
fn from_points(points: &[Coord]) -> Trianglewhere Triangle: Sized,
create this shape from a list of points
source§fn contains<P>(&self, point: P) -> boolwhere
P: Into<Coord>,
fn contains<P>(&self, point: P) -> boolwhere P: Into<Coord>,
returns true if the shape contains point
source§fn translate_by<P>(&self, delta: P) -> Selfwhere
P: Into<Coord>,
Self: Sized,
fn translate_by<P>(&self, delta: P) -> Selfwhere P: Into<Coord>, Self: Sized,
change every point by +
delta
source§fn move_to<P>(&self, point: P) -> Selfwhere
P: Into<Coord>,
Self: Sized,
fn move_to<P>(&self, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read moresource§fn move_center_to<P>(&self, point: P) -> Selfwhere
P: Into<Coord>,
Self: Sized,
fn move_center_to<P>(&self, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,
moves the shapes centerto
point
(and changes every other point to match their original distance and angle) Read moresource§fn rotate_around<P>(&self, degrees: isize, point: P) -> Selfwhere
P: Into<Coord>,
Self: Sized,
fn rotate_around<P>(&self, degrees: isize, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,
rotate shape around a point