# PlaySkeleton2DAnimation

## Description

Plays the given animation by name if it exists with an optional start time (Default 0), optional looping, and optional tween time (Default 0). The tween time will smoothly interpolate the skeleton from its current state to the first frame of the specified animation before it starts animating so that there is no sharp transition. A loop value of 1 will loop forever, a loop value greater than 1 will loop for that many times and then stop, and a loop value of 0 will play the animation once and then stop

## Definition

PlaySkeleton2DAnimation( iSkeleton, anim, starttime, loop, tweentime )

void agk::PlaySkeleton2DAnimation( UINT iSkeleton, const char* anim, float starttime, int loop, float tweentime )

## Parameters

- iSkeleton - ID of the skeleton to modify
- anim - The name of the animation to play
- starttime - An optional offset into the animation to skip some frames
- loop - 1 to loop the animation until stopped, 0 to play it once, greater than 1 to loop that many times
- tweentime - Number of seconds to transition from its current state before animating