sgdk
Sprite Struct Reference

Sprite structure used by the Sprite Engine to store state for a sprite.
WARNING: always use the SPR_addSprite(..) method to allocate Sprite object.
More...

#include <sprite_eng.h>

List of all members.

Public Attributes

u16 status
u16 visibility
const SpriteDefinitiondefinition
void(* onFrameChange )(struct Sprite *sprite)
Animationanimation
AnimationFrameframe
s16 animInd
s16 frameInd
u16 timer
s16 x
s16 y
s16 depth
u16 attribut
u16 VDPSpriteIndex
VDPSpritelastVDPSprite
u16 lastNumSprite
s16 spriteToHide
u32 data
struct Spriteprev
struct Spritenext

Detailed Description

Sprite structure used by the Sprite Engine to store state for a sprite.
WARNING: always use the SPR_addSprite(..) method to allocate Sprite object.

Parameters:
statusInternal state and automatic allocation information (internal)
visibilityvisibility information of current frame for each VDP sprite (max = 16)
spriteDefSprite definition pointer
onFrameChangeCustom callback on frame change event (see SPR_setFrameChangeCallback(..) method)
animationAnimation pointer cache (internal)
frameAnimationFrame pointer cache (internal)
animIndcurrent animation index (internal)
frameIndcurrent frame animation index (internal)
timertimer for current frame (internal)
xcurrent sprite X position on screen offseted by 0x80 (internal VDP position)
ycurrent sprite Y position on screen offseted by 0x80 (internal VDP position)
depthcurrent sprite depth (Z) position used for Z sorting
attributsprite specific attribut and allocated VRAM tile index (see TILE_ATTR_FULL() macro)
VDPSpriteIndexindex of first allocated VDP sprite (0 when no yet allocated)
Number of allocated VDP sprite is defined by definition->maxNumSprite
lastVDPSpritePointer to last VDP sprite used by this Sprite (used internally to update link between sprite)
lastNumSpritethe number of VDP sprite used by the current frame (internal)
spriteToHideinternal
datathis is a free field for user data, use it for whatever you want (flags, pointer...)
prevpointer on previous Sprite in list
nextpointer on next Sprite in list

Used to manage an active sprite in game condition.


The documentation for this struct was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines