Struct mold2d::sprite::SpriteRectangle
[−]
[src]
pub struct SpriteRectangle { pub x: i32, pub y: i32, pub w: u32, pub h: u32, }
A mutable rectangle for a sprite so it can be moved around
Fields
x: i32
y: i32
w: u32
h: u32
Methods
impl SpriteRectangle
[src]
fn new(x: i32, y: i32, w: u32, h: u32) -> SpriteRectangle
fn from_rect(rect: Rect) -> SpriteRectangle
Creates a sprite rectangle from a SDL2 rectangle
fn to_sdl(&self) -> Option<Rect>
Returns a SDL Rect created from the SpriteRectangle Used for rendering SpriteRectangles in SDL
fn apply_change(&mut self, change: &PositionChange)
Mutates a sprite rectangle based on the position change given
Trait Implementations
impl Collision<Rect> for SpriteRectangle
[src]
fn collides_with(&self, other: Rect) -> Option<CollisionSide>
impl Collision<SpriteRectangle> for SpriteRectangle
[src]
fn collides_with(&self, other: SpriteRectangle) -> Option<CollisionSide>
impl Clone for SpriteRectangle
[src]
fn clone(&self) -> SpriteRectangle
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 PartialEq for SpriteRectangle
[src]
fn eq(&self, __arg_0: &SpriteRectangle) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SpriteRectangle) -> bool
This method tests for !=
.