Game Development Reference
In-Depth Information
already treated as a single DisplayObject, sort of like a MovieClip
of images, it
s much easier to rearrange them on Stage and in the
timeline without having to select multiple frames at once.
'
Performance
Even with the extra performance overhead an alpha-channel video
clip brings, it is still more efficient than a series of images, particularly
as the dimensions of the clip increase. This is because Adobe has put
a lot of effort into making the video playback engine perform well
even on modest machines. Also, in the context of Flash
s timeline
model, a PNG sequence requires the renderer to add and remove
images on every frame, which is a more intensive task.
'
Free Motion Blur
The compression used on video tends to have a slight softening effect,
depending on what settings were used in the encoder, and this effect
can actually be helpful in creating a sense of motion blur on videos
with a lot of movement. Since Flash cannot natively do directional
motion blur, this effect would be much harder to produce with a
series of images. Obviously, if the encoder is smudging the video too
much , you might want to change the compression settings.
WHEN PNG S STILL WIN
Say you had an animation sequence of a character crouching. To be as
efficient as possible, you would probably use the same animation for the
character entering the crouch as that coming out of it, just reversing the
latter. This is possible with a sequence of images that you have complete
control over but not so with a video. You would have to create the second
animation separately, and at that point you will have lost any file size sav-
ings from using video in the first place. How you intend to use animation
sequences in your game should dictate which format you use.
Setting Up an Internal Video
Let
'
s walk through a practical example of setting up a timeline-based
video and test the file size improvement. The support files for this exer-
cise can be found in the Chapter 9 examples folder. In this example,
I have a 15-frame running sequence for a character that will need to
loop. It currently exists as an image sequence of PNG files. Open a new
FLA file and save it as ImageSequence.fla. Set the Stage size to 200
×
200. Import the first image from the sequence into Flash. It will prompt
you if you would like to import the whole series; click Yes. You should
now have the image sequence on the Stage. Test the SWF, and you
Search Nedrilad ::




Custom Search