#[repr(C)]pub struct playdate_sprite {Show 63 fields
pub setAlwaysRedraw: Option<unsafe extern "C" fn(flag: c_int)>,
pub addDirtyRect: Option<unsafe extern "C" fn(dirtyRect: LCDRect)>,
pub drawSprites: Option<unsafe extern "C" fn()>,
pub updateAndDrawSprites: Option<unsafe extern "C" fn()>,
pub newSprite: Option<unsafe extern "C" fn() -> *mut LCDSprite>,
pub freeSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub copy: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDSprite>,
pub addSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub removeSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub removeSprites: Option<unsafe extern "C" fn(sprites: *mut *mut LCDSprite, count: c_int)>,
pub removeAllSprites: Option<unsafe extern "C" fn()>,
pub getSpriteCount: Option<unsafe extern "C" fn() -> c_int>,
pub setBounds: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect)>,
pub getBounds: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
pub moveTo: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: c_float, y: c_float)>,
pub moveBy: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, dx: c_float, dy: c_float)>,
pub setImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, image: *mut LCDBitmap, flip: LCDBitmapFlip)>,
pub getImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDBitmap>,
pub setSize: Option<unsafe extern "C" fn(s: *mut LCDSprite, width: c_float, height: c_float)>,
pub setZIndex: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, zIndex: i16)>,
pub getZIndex: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> i16>,
pub setDrawMode: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, mode: LCDBitmapDrawMode)>,
pub setImageFlip: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flip: LCDBitmapFlip)>,
pub getImageFlip: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> LCDBitmapFlip>,
pub setStencil: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap)>,
pub setClipRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, clipRect: LCDRect)>,
pub clearClipRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setClipRectsInRange: Option<unsafe extern "C" fn(clipRect: LCDRect, startZ: c_int, endZ: c_int)>,
pub clearClipRectsInRange: Option<unsafe extern "C" fn(startZ: c_int, endZ: c_int)>,
pub setUpdatesEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>,
pub updatesEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>,
pub setCollisionsEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>,
pub collisionsEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>,
pub setVisible: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>,
pub isVisible: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>,
pub setOpaque: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>,
pub markDirty: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setTag: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, tag: u8)>,
pub getTag: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> u8>,
pub setIgnoresDrawOffset: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>,
pub setUpdateFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteUpdateFunction)>,
pub setDrawFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteDrawFunction)>,
pub getPosition: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: *mut c_float, y: *mut c_float)>,
pub resetCollisionWorld: Option<unsafe extern "C" fn()>,
pub setCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, collideRect: PDRect)>,
pub getCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
pub clearCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setCollisionResponseFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteCollisionFilterProc)>,
pub checkCollisions: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, goalX: c_float, goalY: c_float, actualX: *mut c_float, actualY: *mut c_float, len: *mut c_int) -> *mut SpriteCollisionInfo>,
pub moveWithCollisions: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, goalX: c_float, goalY: c_float, actualX: *mut c_float, actualY: *mut c_float, len: *mut c_int) -> *mut SpriteCollisionInfo>,
pub querySpritesAtPoint: Option<unsafe extern "C" fn(x: c_float, y: c_float, len: *mut c_int) -> *mut *mut LCDSprite>,
pub querySpritesInRect: Option<unsafe extern "C" fn(x: c_float, y: c_float, width: c_float, height: c_float, len: *mut c_int) -> *mut *mut LCDSprite>,
pub querySpritesAlongLine: Option<unsafe extern "C" fn(x1: c_float, y1: c_float, x2: c_float, y2: c_float, len: *mut c_int) -> *mut *mut LCDSprite>,
pub querySpriteInfoAlongLine: Option<unsafe extern "C" fn(x1: c_float, y1: c_float, x2: c_float, y2: c_float, len: *mut c_int) -> *mut SpriteQueryInfo>,
pub overlappingSprites: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, len: *mut c_int) -> *mut *mut LCDSprite>,
pub allOverlappingSprites: Option<unsafe extern "C" fn(len: *mut c_int) -> *mut *mut LCDSprite>,
pub setStencilPattern: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, pattern: *mut [u8; 8])>,
pub clearStencil: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setUserdata: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, userdata: *mut c_void)>,
pub getUserdata: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut c_void>,
pub setStencilImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: c_int)>,
pub setCenter: Option<unsafe extern "C" fn(s: *mut LCDSprite, x: c_float, y: c_float)>,
pub getCenter: Option<unsafe extern "C" fn(s: *mut LCDSprite, x: *mut c_float, y: *mut c_float)>,
}Fields§
§setAlwaysRedraw: Option<unsafe extern "C" fn(flag: c_int)>void playdate->sprite->setAlwaysRedraw(int flag);
When flag is set to 1, this causes all sprites to draw each frame, whether or not they have been marked dirty. This may speed up the performance of your game if the system’s dirty rect tracking is taking up too much time - for example if there are many sprites moving around on screen at once.
addDirtyRect: Option<unsafe extern "C" fn(dirtyRect: LCDRect)>void playdate->sprite->addDirtyRect(LCDRect dirtyRect);
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.
drawSprites: Option<unsafe extern "C" fn()>void playdate->sprite->drawSprites(void);
Draws every sprite in the display list.
updateAndDrawSprites: Option<unsafe extern "C" fn()>void playdate->sprite->updateAndDrawSprites(void);
Updates and draws every sprite in the display list.
newSprite: Option<unsafe extern "C" fn() -> *mut LCDSprite>LCDSprite* playdate->sprite->newSprite(void);
Allocates and returns a new LCDSprite.
freeSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>§copy: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDSprite>LCDSprite* playdate->sprite->copy(LCDSprite *sprite);
Allocates and returns a copy of the given sprite.
addSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->addSprite(LCDSprite *sprite);
Adds the given sprite to the display list, so that it is drawn in the current scene.
removeSprite: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->removeSprite(LCDSprite *sprite);
Removes the given sprite from the display list.
removeSprites: Option<unsafe extern "C" fn(sprites: *mut *mut LCDSprite, count: c_int)>void playdate->sprite->removeSprites(LCDSprite **sprites, int count);
Removes the given count sized array of sprites from the display list.
removeAllSprites: Option<unsafe extern "C" fn()>void playdate->sprite->removeAllSprites(void);
Removes all sprites from the display list.
getSpriteCount: Option<unsafe extern "C" fn() -> c_int>int playdate->sprite->getSpriteCount(void);
Returns the total number of sprites in the display list.
setBounds: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect)>void playdate->sprite->setBounds(LCDSprite *sprite, PDRect bounds);
Sets the bounds of the given sprite with bounds.
getBounds: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>PDRect playdate->sprite->getBounds(LCDSprite *sprite);
Returns the bounds of the given sprite as an PDRect;
moveTo: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: c_float, y: c_float)>void playdate->sprite->moveTo(LCDSprite *sprite, float x, float y);
Moves the given sprite to x, y and resets its bounds based on the bitmap dimensions and center.
moveBy: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, dx: c_float, dy: c_float)>void playdate->sprite->moveBy(LCDSprite *sprite, float dx, float dy);
Moves the given sprite to by offsetting its current position by dx, dy.
setImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, image: *mut LCDBitmap, flip: LCDBitmapFlip)>void playdate->sprite->setImage(LCDSprite *sprite, LCDBitmap *image, LCDBitmapFlip flip);
Sets the given sprite’s image to the given bitmap.
getImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDBitmap>LCDBitmap* playdate->sprite->getImage(LCDSprite *sprite);
Returns the LCDBitmap currently assigned to the given sprite.
setSize: Option<unsafe extern "C" fn(s: *mut LCDSprite, width: c_float, height: c_float)>void playdate->sprite->setSize(LCDSprite *s, float width, float height);
Sets the size. The size is used to set the sprite’s bounds when calling moveTo().
setZIndex: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, zIndex: i16)>void playdate->sprite->setZIndex(LCDSprite *sprite, int16_t zIndex);
Sets the Z order of the given sprite. Higher Z sprites are drawn on top of those with lower Z order.
getZIndex: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> i16>int16_t playdate->sprite->getZIndex(LCDSprite *sprite);
Returns the Z index of the given sprite.
setDrawMode: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, mode: LCDBitmapDrawMode)>void playdate->sprite->setDrawMode(LCDSprite *sprite, LCDBitmapDrawMode mode);
Sets the mode for drawing the sprite’s bitmap.
setImageFlip: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flip: LCDBitmapFlip)>void playdate->sprite->setImageFlip(LCDSprite *sprite, LCDBitmapFlip flip);
Flips the bitmap.
getImageFlip: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> LCDBitmapFlip>LCDBitmapFlip playdate->sprite->getImageFlip(LCDSprite *sprite);
Returns the flip setting of the sprite’s bitmap.
setStencil: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap)>void playdate->sprite->setStencil(LCDSprite *sprite, LCDBitmap* stencil);
Specifies a stencil image to be set on the frame buffer before the sprite is drawn.
setClipRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, clipRect: LCDRect)>void playdate->sprite->setClipRect(LCDSprite *sprite, LCDRect clipRect);
Sets the clipping rectangle for sprite drawing.
clearClipRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->clearClipRect(LCDSprite *sprite);
Clears the sprite’s clipping rectangle.
setClipRectsInRange: Option<unsafe extern "C" fn(clipRect: LCDRect, startZ: c_int, endZ: c_int)>void playdate->sprite->setClipRectsInRange(LCDRect clipRect, int startZ, int endZ);
Sets the clipping rectangle for all sprites with a Z index within startZ and endZ inclusive.
clearClipRectsInRange: Option<unsafe extern "C" fn(startZ: c_int, endZ: c_int)>void playdate->sprite->clearClipRectsInRange(int startZ, int endZ);
Clears the clipping rectangle for all sprites with a Z index within startZ and endZ inclusive.
setUpdatesEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>void playdate->sprite->setUpdatesEnabled(LCDSprite *sprite, int flag);
Set the updatesEnabled flag of the given sprite (determines whether the sprite has its update function called). One is true, 0 is false.
updatesEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>int playdate->sprite->updatesEnabled(LCDSprite *sprite);
Get the updatesEnabled flag of the given sprite.
setCollisionsEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>void playdate->sprite->setCollisionsEnabled(LCDSprite *sprite, int flag);
Set the collisionsEnabled flag of the given sprite (along with the collideRect, this determines whether the sprite participates in collisions). One is true, 0 is false. Set to 1 by default.
collisionsEnabled: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>int playdate->sprite->collisionsEnabled(LCDSprite *sprite);
Get the collisionsEnabled flag of the given sprite.
setVisible: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>void playdate->sprite->setVisible(LCDSprite *sprite, int flag);
Set the visible flag of the given sprite (determines whether the sprite has its draw function called). One is true, 0 is false.
isVisible: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> c_int>int playdate->sprite->isVisible(LCDSprite *sprite);
Get the visible flag of the given sprite.
setOpaque: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>void playdate->sprite->setOpaque(LCDSprite *sprite, int flag);
Marking a sprite opaque tells the sprite system that it doesn’t need to draw anything underneath the sprite, since it will be overdrawn anyway. If you set an image without a mask/alpha channel on the sprite, it automatically sets the opaque flag.
markDirty: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->markDirty(LCDSprite *sprite);
Forces the given sprite to redraw.
setTag: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, tag: u8)>void playdate->sprite->setTag(LCDSprite *sprite, uint8_t tag);
Sets the tag of the given sprite. This can be useful for identifying sprites or types of sprites when using the collision API.
getTag: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> u8>uint8_t playdate->sprite->getTag(LCDSprite *sprite);
Returns the tag of the given sprite.
setIgnoresDrawOffset: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: c_int)>void playdate->sprite->setIgnoresDrawOffset(LCDSprite *sprite, int flag);
When flag is set to 1, the sprite will draw in screen coordinates, ignoring the currently-set drawOffset.
This only affects drawing, and should not be used on sprites being used for collisions, which will still happen in world-space.
setUpdateFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteUpdateFunction)>void playdate->sprite->setUpdateFunction(LCDSprite *sprite, LCDSpriteUpdateFunction *func);
Sets the update function for the given sprite.
setDrawFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteDrawFunction)>void playdate->sprite->setDrawFunction(LCDSprite *sprite, LCDSpriteDrawFunction *func);
Sets the draw function for the given sprite. Note that the callback is only called when the sprite is on screen and has a size specified via playdate→sprite→setSize() or playdate→sprite→setBounds().
getPosition: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: *mut c_float, y: *mut c_float)>void playdate->sprite->getPosition(LCDSprite *sprite, float *x, float *y);
Sets x and y to the current position of sprite.
resetCollisionWorld: Option<unsafe extern "C" fn()>void playdate->sprite->resetCollisionWorld(void);
Frees and reallocates internal collision data, resetting everything to its default state.
setCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, collideRect: PDRect)>void playdate->sprite->setCollideRect(LCDSprite *sprite, PDRect collideRect);
Marks the area of the given sprite, relative to its bounds, to be checked for collisions with other sprites’ collide rects.
getCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>PDRect playdate->sprite->getCollideRect(LCDSprite *sprite);
Returns the given sprite’s collide rect.
clearCollideRect: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->clearCollideRect(LCDSprite *sprite);
Clears the given sprite’s collide rect.
setCollisionResponseFunction: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteCollisionFilterProc)>void playdate->sprite->setCollisionResponseFunction(LCDSprite *sprite, LCDSpriteCollisionFilterProc *func);
Set a callback that returns a SpriteCollisionResponseType for a collision between sprite and other.
LCDSpriteCollisionFilterProc
typedef SpriteCollisionResponseType LCDSpriteCollisionFilterProc(LCDSprite* sprite, LCDSprite* other);checkCollisions: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, goalX: c_float, goalY: c_float, actualX: *mut c_float, actualY: *mut c_float, len: *mut c_int) -> *mut SpriteCollisionInfo>SpriteCollisionInfo* playdate->sprite->checkCollisions(LCDSprite *sprite, float goalX, float goalY, float *actualX, float *actualY, int *len);
Returns the same values as playdate->sprite->moveWithCollisions() but does not actually move the sprite. The caller is responsible for freeing the returned array.
moveWithCollisions: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, goalX: c_float, goalY: c_float, actualX: *mut c_float, actualY: *mut c_float, len: *mut c_int) -> *mut SpriteCollisionInfo>SpriteCollisionInfo* playdate->sprite->moveWithCollisions(LCDSprite *sprite, float goalX, float goalY, float *actualX, float *actualY, int *len);
Moves the given sprite towards goalX, goalY taking collisions into account and returns an array of SpriteCollisionInfo. len is set to the size of the array and actualX, actualY are set to the sprite’s position after collisions. If no collisions occurred, this will be the same as goalX, goalY. The caller is responsible for freeing the returned array.
querySpritesAtPoint: Option<unsafe extern "C" fn(x: c_float, y: c_float, len: *mut c_int) -> *mut *mut LCDSprite>LCDSprite** playdate->sprite->querySpritesAtPoint(float x, float y, int *len);
Returns an array of all sprites with collision rects containing the point at x, y. len is set to the size of the array. The caller is responsible for freeing the returned array.
querySpritesInRect: Option<unsafe extern "C" fn(x: c_float, y: c_float, width: c_float, height: c_float, len: *mut c_int) -> *mut *mut LCDSprite>LCDSprite** playdate->sprite->querySpritesInRect(float x, float y, float width, float height, int *len);
Returns an array of all sprites with collision rects that intersect the width by height rect at x, y. len is set to the size of the array. The caller is responsible for freeing the returned array.
querySpritesAlongLine: Option<unsafe extern "C" fn(x1: c_float, y1: c_float, x2: c_float, y2: c_float, len: *mut c_int) -> *mut *mut LCDSprite>LCDSprite** playdate->sprite->querySpritesAlongLine(float x1, float y1, float x2, float y2, int *len);
Returns an array of all sprites with collision rects that intersect the line connecting x1, y1 and x2, y2. len is set to the size of the array. The caller is responsible for freeing the returned array.
querySpriteInfoAlongLine: Option<unsafe extern "C" fn(x1: c_float, y1: c_float, x2: c_float, y2: c_float, len: *mut c_int) -> *mut SpriteQueryInfo>SpriteQueryInfo* playdate->sprite->querySpriteInfoAlongLine(float x1, float y1, float x2, float y2, int *len);
Returns an array of SpriteQueryInfo for all sprites with collision rects that intersect the line connecting x1, y1 and x2, y2. len is set to the size of the array. If you don’t need this information, use querySpritesAlongLine() as it will be faster. The caller is responsible for freeing the returned array.
overlappingSprites: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, len: *mut c_int) -> *mut *mut LCDSprite>LCDSprite** playdate->sprite->overlappingSprites(LCDSprite *sprite, int *len);
Returns an array of sprites that have collide rects that are currently overlapping the given sprite’s collide rect. len is set to the size of the array. The caller is responsible for freeing the returned array.
allOverlappingSprites: Option<unsafe extern "C" fn(len: *mut c_int) -> *mut *mut LCDSprite>LCDSprite** playdate->sprite->allOverlappingSprites(int *len);
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). len is set to the size of the array. The caller is responsible for freeing the returned array.
setStencilPattern: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, pattern: *mut [u8; 8])>void playdate->sprite->setStencilPattern(LCDSprite* sprite, uint8_t pattern[8]);
Sets the sprite’s stencil to the given pattern.
clearStencil: Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>void playdate->sprite->clearStencil(LCDSprite *sprite);
Clears the sprite’s stencil.
setUserdata: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, userdata: *mut c_void)>void playdate->sprite->setUserdata(LCDSprite *sprite, void* userdata);
getUserdata: Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut c_void>void* playdate->sprite->getUserdata(LCDSprite *sprite);
Sets and gets the sprite’s userdata, an arbitrary pointer used for associating the sprite with other data.
setStencilImage: Option<unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: c_int)>void playdate->sprite->setStencilImage(LCDSprite *sprite, LCDBitmap* stencil, int tile);
Specifies a stencil image to be set on the frame buffer before the sprite is drawn. If tile is set, the stencil will be tiled. Tiled stencils must have width evenly divisible by 32.
setCenter: Option<unsafe extern "C" fn(s: *mut LCDSprite, x: c_float, y: c_float)>void playdate->sprite->setCenter(LCDSprite *sprite, float x, float y);
Sets the sprite’s drawing center as a fraction (ranging from 0.0 to 1.0) of the height and width. Default is 0.5, 0.5 (the center of the sprite). This means that when you call sprite→moveTo(sprite, x, y), the center of your sprite will be positioned at x, y. If you want x and y to represent the upper left corner of your sprite, specify the center as 0, 0.
getCenter: Option<unsafe extern "C" fn(s: *mut LCDSprite, x: *mut c_float, y: *mut c_float)>void playdate->sprite->getCenter(LCDSprite *sprite, float *outx, float *outy);
Sets the values in outx and outy to the sprite’s drawing center as a fraction (ranging from 0.0 to 1.0) of the height and width.
Trait Implementations§
Source§impl Clone for playdate_sprite
impl Clone for playdate_sprite
Source§fn clone(&self) -> playdate_sprite
fn clone(&self) -> playdate_sprite
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for playdate_sprite
impl Debug for playdate_sprite
Source§impl Default for playdate_sprite
impl Default for playdate_sprite
Source§fn default() -> playdate_sprite
fn default() -> playdate_sprite
Source§impl Hash for playdate_sprite
impl Hash for playdate_sprite
Source§impl Ord for playdate_sprite
impl Ord for playdate_sprite
Source§impl PartialEq for playdate_sprite
impl PartialEq for playdate_sprite
Source§impl PartialOrd for playdate_sprite
impl PartialOrd for playdate_sprite
Source§fn partial_cmp(&self, other: &playdate_sprite) -> Option<Ordering>
fn partial_cmp(&self, other: &playdate_sprite) -> Option<Ordering>
impl Copy for playdate_sprite
impl Eq for playdate_sprite
impl StructuralPartialEq for playdate_sprite
Auto Trait Implementations§
impl Freeze for playdate_sprite
impl RefUnwindSafe for playdate_sprite
impl Send for playdate_sprite
impl Sync for playdate_sprite
impl Unpin for playdate_sprite
impl UnwindSafe for playdate_sprite
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 252 bytes