# PlaySprite

## Description

Begins the animation of a sprite based on the given values. Animation speed is based on animation frames per second and is not affected by the drawing frame rate.

## Definition

PlaySprite( iSpriteIndex )

void agk::PlaySprite( UINT iSpriteIndex )

PlaySprite( iSpriteIndex, fFps )

void agk::PlaySprite( UINT iSpriteIndex, float fFps )

PlaySprite( iSpriteIndex, fFps, iLoop )

void agk::PlaySprite( UINT iSpriteIndex, float fFps, int iLoop )

PlaySprite( iSpriteIndex, fFps, iLoop, iFromFrame, iToFrame )

void agk::PlaySprite( UINT iSpriteIndex, float fFps, int iLoop, int iFromFrame, int iToFrame )

## Parameters

- iSpriteIndex - The ID of the sprite to animate.
- fFps - Frames per second. The number of frames the sprite should attempt to cycle through every second (optional, default 10).
- iLoop - The looping mode of the sprite, 0 equals do not loop, 1 equals loop forever (optional, default 1).
- iFromFrame - The frame to begin at, frames start at 1 (optional, default minus 1).
- iToFrame - The frame to end at, frames end at GetSpriteFrameCount (optional, default minus 1).