sgdk: Sprite Struct Reference

sgdk

- Main Page
- Related Pages
- Classes
- Files

- Class List

Public Attributes
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 SpriteDefinition * | definition
void(* | onFrameChange )(struct Sprite *sprite)
Animation * | animation
AnimationFrame * | frame
s16 | animInd
s16 | frameInd
u16 | timer
s16 | x
s16 | y
s16 | depth
u16 | attribut
u16 | VDPSpriteIndex
VDPSprite * | lastVDPSprite
u16 | lastNumSprite
s16 | spriteToHide
u32 | data
struct Sprite * | prev
struct Sprite * | next

## 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:

  status | Internal state and automatic allocation information (internal)
  visibility | visibility information of current frame for each VDP sprite (max = 16)
  spriteDef | Sprite definition pointer
  onFrameChange | Custom callback on frame change event (see SPR_setFrameChangeCallback(..) method)
  animation | Animation pointer cache (internal)
  frame | AnimationFrame pointer cache (internal)
  animInd | current animation index (internal)
  frameInd | current frame animation index (internal)
  timer | timer for current frame (internal)
  x | current sprite X position on screen offseted by 0x80 (internal VDP position)
  y | current sprite Y position on screen offseted by 0x80 (internal VDP position)
  depth | current sprite depth (Z) position used for Z sorting
  attribut | sprite specific attribut and allocated VRAM tile index (see TILE_ATTR_FULL() macro)
  VDPSpriteIndex | index of first allocated VDP sprite (0 when no yet allocated) Number of allocated VDP sprite is defined by definition->maxNumSprite
  lastVDPSprite | Pointer to last VDP sprite used by this Sprite (used internally to update link between sprite)
  lastNumSprite | the number of VDP sprite used by the current frame (internal)
  spriteToHide | internal
  data | this is a free field for user data, use it for whatever you want (flags, pointer...)
  prev | pointer on previous Sprite in list
  next | pointer 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:

- sprite_eng.h

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines