Struct gfx4games::graphics::rect::Rect
[−]
[src]
pub struct Rect { pub dx: f32, pub dy: f32, pub rw: f32, pub rh: f32, // some fields omitted }
Rectangle structure
Fields
dx: f32
X position
dy: f32
Y position
rw: f32
Width
rh: f32
Height
Methods
impl Rect
[src]
pub fn new(x: f32, y: f32, w: f32, h: f32) -> Rect
[src]
pub fn moveBy(&mut self, x: f32, y: f32)
[src]
Move rectangle(Not works correctly) :(
pub fn draw(&mut self, ctx: &mut Context)
[src]
Draw rectangle
pub fn collide(&mut self, other: &Rect) -> bool
[src]
Checking for collision using ncollide2d
pub fn set_color(&mut self, color: [f32; 3])
[src]
Set's rectangle color