| void Pawn_Initialize( |
| ) |
Initialize a game pawn.
| pawn Pawn* | Address of game pawn structure to initialize. This is he structure to be used for all other functions. |
| sprtList const Pawn_Sprite* | Array of all sprite layers used to display the pawn. See <Pawn_Sprite> for details. |
| sprtNum u8 | Size of the 'sprtList' table (in entries number). |
| sprtID u8 | First srite index to use for the pawn. The pawn will use all sprite indexes from 'sprtID' to 'sprtID + sprtNum - 1'. If <PAWN_ID_PER_LAYER> compile option is activated, this parmeter is not used as each sprit layer define it's own sprite index. |
| actList const Pawn_Action* | Array of pawn action. Needed to use Pawn_SetAction function. |
| void Pawn_SetPosition( |
| ) |
Set game pawn position. Force movement even if collision is activated.
| pawn Pawn* | Address of game pawn structure to move. |
| x PAWN_POS | New X coordinate (in pixels). |
| y PAWN_POS | New Y coordinate (in pixels). |
| inline PAWN_POS Pawn_GetPositionX( |
| ) |
Get the X coordinate of the pawn's position.
| pawn Pawn* | Pointer to pawn structure. |
X coordinate of the pawn's position.
| inline PAWN_POS Pawn_GetPositionY( |
| ) |
Get the Y coordinate of the pawn's position.
| pawn Pawn* | Pointer to pawn structure. |
Y coordinate of the pawn's position.
| void Pawn_ForceSetAction( |
| ) |
Force to set game pawn action id.
| pawn Pawn* | Address of game pawn structure to setup. |
| id u8 | New action index. |
| void Pawn_SetAction( |
| ) |
Set game pawn current action index.
| pawn Pawn* | Address of game pawn structure to setup. |
| id u8 | New action index. |
| inline void Pawn_RestartAction( |
| ) |
Restart the current action.
| pawn Game_Pawn* | Address of game pawn structure to setup. |
| inline u8 Pawn_GetAction( |
| ) |
Get the current action ID of the pawn.
| pawn Pawn* | Pointer to pawn structure. |
Current action ID of the pawn.
| inline void Pawn_SetTileMap( |
| ) |
Set the tile map to be used for collision. Available only when PAWN_TILEMAP_SRC is set to PAWN_TILEMAP_SRC_RAM.
| map const u8* | Pointer to RAM buffer with the tile map. Size must be PAWN_TILEMAP_WIDTH * PAWN_TILEMAP_HEIGHT. |
| void Pawn_SetEnable( |
| ) |
Set if pawn is enable or disable. Disabled pawn will not be updated nor drawn.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| enable bool | TRUE to enable the pawn, FALSE to disable it. |
| inline void Pawn_Disable( |
| ) |
Disable a pawn. Disabled pawn will not be updated nor drawn.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| inline void Pawn_Enable( |
| ) |
Enable a pawn. Enabled pawn will be updated and drawn.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| void Pawn_Update( |
| ) |
Update animation of the game pawn. Must be called once a frame.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| inline void Pawn_SetDirty( |
| ) |
Mark the pawn as dirty. This will force the pawn to be redrawn.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| inline void Pawn_SetColorBlend( |
| ) |
Enable or disable sprite color blending effect.
| pawn Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| enable bool | TRUE to enable color blending, FALSE to disable it. |
| void Pawn_Draw( |
| ) |
Update rendering of the game pawn. Must be called once a frame.
| pawn Pawn* | Address of game pawn structure to draw. |
| inline void Pawn_SetPatternAddress( |
| ) |
Set the base address of the sprite pattern data. Only available if PAWN_USE_RT_LOAD compile option is set to TRUE.
| pawn Pawn* | Address of game pawn structure to initialize. |
| addr const void* | Base address of the sprite pattern data. |
| inline void Pawn_SetSpriteFX( |
| ) |
Set sprite effect. Only available if PAWN_USE_RT_LOAD and PAWN_USE_SPRT_FX compile options are set to TRUE.
| pawn Pawn* | Address of game pawn structure to initialize. |
| fx u8 | Sprite effect (crop, flip, mask, rotate). |
| void Pawn_SetMovement( |
| ) |
Set pawn relative movement. Collision can prevent part of the movement. Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Pawn* | Address of game pawn structure to move. |
| x | New X movement (in pixels). |
| y | New Y movement (in pixels). |
| inline void Pawn_SetTargetPosition( |
| ) |
Set pawn absolute movement. Collision can prevent part of the movement. Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Pawn* | Address of game pawn structure to move. |
| x PAWN_POS | New X coordinate (in pixels). |
| y PAWN_POS | New Y coordinate (in pixels). |
Set pawn physics callback Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
| pawn | Address of game pawn structure to initialize. |
| pcb | Callback function to be called when physics events occurs. |
| ccb | Callback function to be called when collision events occurs. |
| boundX | Bounding box X extend (in pixels, from the pawn's origin). |
| boundY | Bounding box Y extend (in pixels, from the pawn's origin). |
| inline u8 Pawn_GetPhysicsState( |
| ) |
Get pawn physics state. Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Pawn* | Pointer to pawn structure. |
Pawn's physics state.
Get the X coordinate of the cell that triggered a callback. The value is only valid within a callback. Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
X coordinate of the current cell.
Get the Y coordinate of the cell that triggered a callback. The value is only valid within a callback. Only available if PAWN_USE_PHYSICS compile option is set to TRUE.
Y coordinate of the current cell.