Struct lux::graphics::Ellipse [] [src]

#[must_use = "Ellipses only contain context, and must be drawn with `fill()`, `stroke()`, or `fill_stroke()`"]
pub struct Ellipse<'a, C: 'a> {
    // some fields omitted
}

An ellipse that can be drawn to the screen.

Methods

impl<'a, C> Ellipse<'a, C>

fn spokes(&mut self, spokes: u16) -> &mut Self

Sets the number of segments that are used to approximate a circle.

### Example ```rust,no_run

extern crate lux;

use lux::prelude::*; use lux::graphics::ColorVertex;

fn main() {

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).spokes(5).draw();

}

impl<'a, C> Ellipse<'a, C> where C: Canvas + 'a

fn fill(&mut self)

Fills in the ellipse with a solid color.

Trait Implementations

impl<'a, C> Transform for Ellipse<'a, C>

fn current_matrix(&self) -> &[[Float; 4]; 4]

fn current_matrix_mut(&mut self) -> &mut [[Float; 4]; 4]

fn apply_matrix(&mut self, other: [[Float; 4]; 4]) -> &mut Self

fn translate(&mut self, dx: Float, dy: Float) -> &mut Self

fn scale(&mut self, sx: Float, sy: Float) -> &mut Self

fn shear(&mut self, sx: Float, sy: Float) -> &mut Self

fn rotate(&mut self, theta: Float) -> &mut Self

fn rotate_around(&mut self, point: (Float, Float), theta: Float) -> &mut Self

fn with_matrix<F, R>(&mut self, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotation<F, R>(&mut self, rotation: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_translate<F, R>(&mut self, dx: Float, dy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_scale<F, R>(&mut self, scale_x: Float, scale_y: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_shear<F, R>(&mut self, sx: Float, sy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotate_around<F, R>(&mut self, point: (Float, Float), theta: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

impl<'a, C> Colored for Ellipse<'a, C>

fn get_color(&self) -> [Float; 4]

fn color<A: Color>(&mut self, color: A) -> &mut Self

fn with_color<F, C: Color>(&mut self, color: C, f: F) where F: FnOnce(&mut Self)