Game Development Reference
In-Depth Information
im#.png
image. I assume the issue will be fixed by the time you read this topic;
but if it is not, at least now you know how to work around it.
Since the
Create Keyframes from Selection
command creates a very fast sequence of key-
frames and will almost never match the desired animation speed, SpriteBuilder provides a
way to evenly space a selection of keyframes.
In order to select multiple keyframes, you can either click on them with the Shift key held
down or simply click with your mouse on an empty area on the Timeline (where the key-
frames are) and start dragging. This will draw a selection rectangle that will select all key-
frames inside the rectangle when you let go of the mouse button.
With the three sprite frame animation keyframes selected, select the
Animation
Stretch
Selected Keyframes
menu item as seen in
Figure 12-2
.
Figure 12-2
.
Spacing keyframes equally can be done via the Stretch Selected Keyframes command
This will bring up a small dialog where you can enter a
Stretch Factor
value. Enter
3.0
as
the value and click
Done
. The keyframes should now be further apart.
Since the player is closing his eye lids in the animation, it should also open them again a
short while later. Move the Timeline Cursor to the position where the player should open
its eyes again, perhaps half a second after the last sprite frame keyframe.
With the
CCSprite
root node still selected, select
player-anim1.png
and
player-anim2.png
in the SpriteSheets/Global Sprite Sheet. Or if you still have all three selected, you can also
Search WWH ::
Custom Search