PlaydateSprite

Struct PlaydateSprite 

Source
pub struct PlaydateSprite { /* private fields */ }

Implementations§

Source§

impl PlaydateSprite

Source

pub fn set_always_redraw(&self, flag: bool)

When flag is set to 1, the given sprite will always redraw.

Source

pub fn add_dirty_rect(&self, dirty_rect: SideOffsets<i32>)

Marks the given dirtyRect (in screen coordinates) as needing a redraw. Graphics drawing functions now call this automatically, adding their drawn areas to the sprite’s dirty list, so there’s usually no need to call this manually.

Source

pub fn draw_sprites(&self)

Draws every sprite in the display list.

Source

pub fn update_and_draw_sprites(&self)

Updates and draws every sprite in the display list.

Source

pub fn add_sprite(&self, sprite: impl AsRef<Sprite>)

Adds the given sprite to the display list, so that it is drawn in the current scene.

Source

pub fn remove_sprite(&self, sprite: impl AsRef<Sprite>)

Removes the given sprite from the display list.

Source

pub fn remove_sprites(&self, sprites: &[&Sprite])

Removes the given count sized array of sprites from the display list.

Source

pub fn remove_all_sprites(&self)

Removes all sprites from the display list.

Source

pub fn get_sprite_count(&self) -> usize

Returns the total number of sprites in the display list.

Source

pub fn set_clip_rects_in_range( &self, clip_rect: SideOffsets<i32>, start_z: i32, end_z: i32, )

Sets the clipping rectangle for all sprites with a Z index within startZ and endZ inclusive.

Source

pub fn clear_clip_rects_in_range(&self, start_z: i32, end_z: i32)

Clears the clipping rectangle for all sprites with a Z index within startZ and endZ inclusive.

Source

pub fn reset_collision_world(&self)

Frees and reallocates internal collision data, resetting everything to its default state.

Source

pub fn query_sprites_at_point(&self, pos: Vec2<f32>) -> Vec<Ref<'_, Sprite>>

Source

pub fn query_sprites_in_rect(&self, rect: Rect<f32>) -> Vec<Ref<'_, Sprite>>

Source

pub fn query_sprites_along_line( &self, x1: f32, y1: f32, x2: f32, y2: f32, ) -> Vec<Ref<'_, Sprite>>

Source

pub fn query_sprite_info_along_line( &self, x1: f32, y1: f32, x2: f32, y2: f32, ) -> Vec<SpriteQueryInfo<'_>>

Source

pub fn all_overlapping_sprites(&self) -> Vec<Ref<'_, Sprite>>

Returns an array of all sprites that have collide rects that are currently overlapping. Each consecutive pair of sprites is overlapping (eg. 0 & 1 overlap, 2 & 3 overlap, etc).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.