Struct axle::Point
[−]
[src]
pub struct Point { /* fields omitted */ }
Immutable point type, consisting of x and y.
Methods
impl Point
[src]
pub fn new(x: i32, y: i32) -> Point
[src]
Creates a new point from the given coordinates.
pub fn from_ll(raw: SDL_Point) -> Point
[src]
pub fn raw_slice(slice: &[Point]) -> *const SDL_Point
[src]
pub fn raw(&self) -> *const SDL_Point
[src]
pub fn offset(&self, x: i32, y: i32) -> Point
[src]
Returns a new point by shifting this point's coordinates by the given x and y values.
pub fn scale(&self, f: i32) -> Point
[src]
Returns a new point by multiplying this point's coordinates by the given scale factor.
pub fn x(&self) -> i32
[src]
Returns the x-coordinate of this point.
pub fn y(&self) -> i32
[src]
Returns the y-coordinate of this point.
Trait Implementations
impl Neg for Point
[src]
type Output = Point
The resulting type after applying the -
operator.
fn neg(self) -> Point
[src]
Performs the unary -
operation.
impl AsRef<SDL_Point> for Point
[src]
impl Copy for Point
[src]
impl DerefMut for Point
[src]
fn deref_mut(&mut self) -> &mut SDL_Point
[src]
Example
use sdl2::rect::Point; let mut point = Point::new(2, 3); point.x = 4; assert_eq!(4, point.x);
impl PartialEq<Point> for Point
[src]
fn eq(&self, other: &Point) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Mul<i32> for Point
[src]
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Point
[src]
Performs the *
operation.
impl Debug for Point
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl Eq for Point
[src]
impl From<(i32, i32)> for Point
[src]
impl From<SDL_Point> for Point
[src]
impl Div<i32> for Point
[src]
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Point
[src]
Performs the /
operation.
impl Add<Point> for Point
[src]
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: Point) -> Point
[src]
Performs the +
operation.
impl Clone for Point
[src]
fn clone(&self) -> Point
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Sub<Point> for Point
[src]
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, rhs: Point) -> Point
[src]
Performs the -
operation.