blackberry-gaming/GamePlay — Issue #52: Loading Animations from .animation files
Author: seanpaultaylor
Created: 2011-12-01 05:03:29+00:00
State: open

User Code:

// The animation target.
Node* targetNode = _scene->findNode(“boyShape”);

// Create the animation from file targeting the node.
Animation* animation = Animation::create(targetNode, “res/wizard.animation”);

// Play the default animation clip.
animation->play();

Possible sample .animation file:
-----------------------------------------------

animation wizardMove
{
property = ANIMATE_TRANSLATE
keyCount = 2
keyTimes = 0, 24
keyValues = 0.0, 0.0, 0.0; 0.0, 0.0, -5.0
//keyIn = 0.0
//keyOut = 1.0
curve = LINEAR
frameCount = 300

clip right_arm
{
begin = 61
end = 120
repeatCount = INDEFINITE
}
}