SpriteLibrary
SpriteLibrary
SpriteLibrary
Sprite Class
Sprite Methods
AddAnimation Method
AnimateJustAFewTimes Method
AnimateOnce Method
CancelMoveTo Method
ChangeAnimation Method
ChangeAnimationSpeed Method
ChangeFrameAnimationSpeed Method
CheckSpriteHitsSprite Method
ConvertDegreesToRadians Method
ConvertRadiansToDegrees Method
Destroy Method
GetAnimationSpeed Method
GetFrameAnimationSpeed Method
GetImage Method
GetSpriteBaseImageCenter Method
GetSpriteDegrees Method
GetSpritePictureboxCenter Method
GetSpriteRadans Method
GetSpriteVector Method
HideSprite Method
IsPaused Method
MoveTo Method
Pause Method
PutBaseImageLocation Method
PutPictureBoxLocation Method
RecalcPictureBoxLocation Method
ReplaceImage Method
ReturnAdjustmentRatio Method
SendToBack Method
SendToFront Method
SetName Method
SetSize Method
SetSpriteDirection Method
SetSpriteDirectionDegrees Method
SetSpriteDirectionRadians Method
SetSpriteDirectionToPoint Method
SpriteAdjustedPoint Method
SpriteAtImagePoint Method
SpriteAtPictureBoxPoint Method
SpriteCanMoveOnImage Method
SpriteCanMoveOnPictureBox Method
SpriteIntersectsRectangle Method
UnhideSprite Method
UnPause Method

Sprite AnimateJustAFewTimes Method

Start a new animation. It will complete the animation the number of times you specify. For example, if your sprite is walking, and one animation is one step, specifying 4 here will result in your sprite taking 4 steps and then the animation stops. You will want to make sure you are checking for when the animation stops, using the SpriteAnimationComplete event, checking the Sprite.AnimationDone flag.

Namespace: SpriteLibrary
Assembly: SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.5 (1.0.0.5)
Syntax
C#
Copy

    public void AnimateJustAFewTimes(
    	int WhichAnimation,
    	int HowManyAnimations,
    	int AnimationFrameToEndOn = -1
    )

#### Parameters

WhichAnimation
  Type: System
  Int32
  The animation index you want to use
HowManyAnimations
  Type: System
  Int32
  The number of animations to do before it stops
AnimationFrameToEndOn (Optional)
  Type: System
  Int32
  Once the animation has finished, display this animation frame. -1, or any number that is not an actual frame, will show the last frame of the animation.

See Also

#### Reference

Sprite Class
SpriteLibrary Namespace