CRM64Pro GDK v0.15.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
CRM64Pro::Sprite

Sprite Object class. More...

Detailed Description

Sprite Object class.

Public Member Functions

bool info (Sint32 iMode=0) override
 Request Sprite object information.
const string & getName () const override
 Get the name.
Uint32 getID () const override
 Get the ID.
Sint32 assignImage (Sint32 idImage, Sint32 iOwnership=0)
 Assign an Image to this sprite.
Sint32 getImage () const
 Get the assigned Image of this sprite.
bool setOffset (Sint32 iX, Sint32 iY)
 Set the sprite offsets for creating the animations and frames.
bool getOffset (Sint32 *iX, Sint32 *iY) const
 Get the sprite offsets (frames and animations).
bool pause ()
 Pause the sprite animation.
bool resume ()
 Resume from a previous paused sprite animation.
eGeneralStatus status () const
 Get the sprite status.
bool setSpeed (float fSpeed)
 Set the sprite speed.
Sint32 getAnimCount () const
 Get number of animations.
Sint32 getAnimCurrent () const
 Get current animation number.
bool selectAnim (Sint32 iAnim)
 Select an animation by state or by number.
bool setAnimType (Sint32 iAnim, eSpriteType eType)
 Set the animation type.
bool getAnimType (Sint32 iAnim, eSpriteType *pType) const
 Get the animation type.
bool setAnimState (Sint32 iAnim, Sint32 iState)
 Set the animation state.
bool getAnimState (Sint32 iAnim, Sint32 *iState) const
 Get the animation state.
bool orderAnimState (Sint32 iState=-1)
 Sequentially re-indexes the low-state IDs for animations to ensure a contiguous sequence.
bool setAnimHotSpot (Sint32 iAnim, Sint32 iHotX, Sint32 iHotY)
 Set the animation hotspot.
bool getAnimHotSpot (Sint32 iAnim, Sint32 *iHotX, Sint32 *iHotY) const
 Get the animation hotspot.
bool setAnimRange (Sint32 iAnim, Sint32 iFrameStart, Sint32 iFrameEnd)
 Set the animation frame range.
bool getAnimRange (Sint32 iAnim, Sint32 *iFrameStart, Sint32 *iFrameEnd) const
 Get the animation frame range.
Sint32 getFrameCount (Sint32 iAnim) const
 Get number of frames for the given animation.
Sint32 getFrameCurrent () const
 Get current frame number for the given animation.
bool selectFrame (Sint32 iAnim, Sint32 iFrame)
 Select a frame for the given animation.
bool setFrameTime (Sint32 iAnim, Sint32 iFrame, Uint16 iTime)
 Set the frame time duration.
bool getFrameTime (Sint32 iAnim, Sint32 iFrame, Uint16 *iTime) const
 Get the frame time duration.
bool setPosition (float fX, float fY, Sint32 iInterpolation=0)
 Set the sprite position.
float getX () const
 Get the sprite X position.
float getY () const
 Get the sprite Y position.
Sint32 render (Sint32 idRes=0)
 Render the sprite.
Sint32 renderEx (float fScaleX=1.0f, float fScaleY=1.0f, const double dAngle=0.0, const SDL_FPoint *poCenter=nullptr, const SDL_FlipMode rf=SDL_FLIP_NONE, Sint32 idRes=0)
 Render the sprite with extended options.
Sint32 save (const string &sCDCFile, const string &sResourceName="")
 Save the sprite to a CDC file.
Sint32 save (const Sint32 idCDC, const string &sResourceName="")
 Save the sprite to a CDC file.