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