Struct rugra::rect::Rect
[−]
[src]
pub struct Rect<'a> { /* fields omitted */ }
Rectangle
Methods
impl<'a> Rect<'a>
[src]
fn new() -> Self
Create new rectangle
fn width(&mut self, w: f32) -> &mut Self
Set the width of the rectangle
fn height(&mut self, h: f32) -> &mut Self
Set the height of the rectangle
fn x(&mut self, x: f32) -> &mut Self
Set the x coordinate of the rectangle
fn y(&mut self, y: f32) -> &mut Self
Set the y coordinate of the rectangle
fn color(&mut self, r: u8, g: u8, b: u8) -> &mut Self
Set the color of the rectangle
fn alpha(&mut self, a: u8) -> &mut Self
Set the opacity of the rectangle
fn go(&mut self, x: f32, y: f32) -> &mut Self
Move the rectangle relative to the current position
fn rotate(&mut self, a: f32) -> &mut Self
Rotate the rectangle where a is given in degrees
fn step(&mut self, size: f32) -> &mut Self
Step in the current direction
fn length_to(&self, (x, y): (f32, f32)) -> f32
Get the length to a given point
fn pos(&self) -> (f32, f32)
Get the position of the rectangle
fn set(&mut self, (x, y): (f32, f32)) -> &mut Self
Set the position of the rectangle
fn draw(&mut self, window: &mut Window)
Draw the rectangle to a window