pub struct Ellipse<'a, C: 'a> { /* private fields */ }Expand description
An ellipse that can be drawn to the screen.
Implementations§
Source§impl<'a, C> Ellipse<'a, C>
impl<'a, C> Ellipse<'a, C>
Sourcepub fn segments(&mut self, segments: u16) -> &mut Self
pub fn segments(&mut self, segments: u16) -> &mut Self
Sets the number of segments that are used to approximate a circle.
§Example
use lux::prelude::*;
use lux::graphics::ColorVertex;
let mut window = Window::new().unwrap();
let mut frame = window.frame();
let (x, y, size) = (10.0, 10.0, 50.0);
// draw a pentagon
frame.circle(x, y, size).segments(5).draw();Sourcepub fn line_length(&mut self, line_length: u16) -> &mut Self
pub fn line_length(&mut self, line_length: u16) -> &mut Self
Instead of
Trait Implementations§
Source§impl<'a, C> Transform for Ellipse<'a, C>
impl<'a, C> Transform for Ellipse<'a, C>
Source§fn current_matrix_mut(&mut self) -> &mut [[Float; 4]; 4]
fn current_matrix_mut(&mut self) -> &mut [[Float; 4]; 4]
Return a mutible reference to the current matrix.
Source§fn apply_matrix(&mut self, other: [[Float; 4]; 4]) -> &mut Self
fn apply_matrix(&mut self, other: [[Float; 4]; 4]) -> &mut Self
Multiplies the current matrix against another.
self = self * other.Source§fn translate(&mut self, dx: Float, dy: Float) -> &mut Self
fn translate(&mut self, dx: Float, dy: Float) -> &mut Self
Applies a translation transformation to the matrix.
Source§fn scale(&mut self, sx: Float, sy: Float) -> &mut Self
fn scale(&mut self, sx: Float, sy: Float) -> &mut Self
Applies a scaling transformation to the matrix.
Source§fn shear(&mut self, sx: Float, sy: Float) -> &mut Self
fn shear(&mut self, sx: Float, sy: Float) -> &mut Self
Applies a shearing transformation to the matrix.
Source§fn rotate(&mut self, theta: Float) -> &mut Self
fn rotate(&mut self, theta: Float) -> &mut Self
Applies a rotation transformation to the matrix.
Source§fn rotate_around(&mut self, point: (Float, Float), theta: Float) -> &mut Self
fn rotate_around(&mut self, point: (Float, Float), theta: Float) -> &mut Self
Combines rotation with translation to effectively
rotate around a given point.
Source§fn with_matrix<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn with_matrix<F, R>(&mut self, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Used when you want to make several successive calls to transformations
on a single stacked matrix. Read more
Source§fn with_rotation<F, R>(&mut self, rotation: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn with_rotation<F, R>(&mut self, rotation: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Similar to
with_matrix but with a rotation applied
for the duration of the closure.Source§fn with_translate<F, R>(&mut self, dx: Float, dy: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn with_translate<F, R>(&mut self, dx: Float, dy: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Similar to
with_matrix but with a translation applied
for the duration of the closure.Source§fn with_scale<F, R>(&mut self, scale_x: Float, scale_y: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn with_scale<F, R>(&mut self, scale_x: Float, scale_y: Float, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Similar to
with_matrix but with a scale applied
for the duration of the closure.Auto Trait Implementations§
impl<'a, C> Freeze for Ellipse<'a, C>
impl<'a, C> RefUnwindSafe for Ellipse<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Ellipse<'a, C>where
C: Send,
impl<'a, C> Sync for Ellipse<'a, C>where
C: Sync,
impl<'a, C> Unpin for Ellipse<'a, C>
impl<'a, C> !UnwindSafe for Ellipse<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more