Positionable

Trait Positionable 

Source
pub trait Positionable {
    // Required methods
    fn x(&self) -> f32;
    fn set_x(&self, val: f32);
    fn y(&self) -> f32;
    fn set_y(&self, val: f32);
    fn set_position(&self, x: f32, y: f32);
}
Expand description

The Positionable should be implemented by objects intended to have 2D spatial position.

Required Methods§

Source

fn x(&self) -> f32

The horizontal position.

Source

fn set_x(&self, val: f32)

Set horizontal position.

Source

fn y(&self) -> f32

The vertical position.

Source

fn set_y(&self, val: f32)

Set vertical position.

Source

fn set_position(&self, x: f32, y: f32)

Sets both the horizontal and vertical position

§Arguments
  • x - The horizontal position.
  • y - The vertical position.

Implementors§