17.1 Overview

Animations are Hollywood objects that contain several frames of image data. They can be streamed from disk or they can be buffered entirely in memory. To stream an animation from disk, you can use the OpenAnim() command to open the animation file or, alternatively, set the FromDisk tag to True in LoadAnim() or the @ANIM preprocessor command to True. To load an animation entirely into memory, use the LoadAnim() command. It is recommended, though, to always stream larger animations because buffering all frames will require lots of memory.

Here is how you can open an animation for streaming from disk using the @ANIM preprocessor command (of course, you could also use the OpenAnim() command instead):

 
@ANIM 1, "test.anim", {FromDisk = True}

By default, Hollywood can open the animation formats IFF ANIM and GIF ANIM. There are, however, several plugins which extend the number of animation formats you can open with Hollywood. For example, you can download plugins for the APNG and FLI/FLC formats from the official Hollywood portal.

Animations can be played using the PlayAnim() command. PlayAnim() will block the script execution, but you set the Async tag to True to get an asynchronous draw object from PlayAnim() which you can then use to play the animation asynchronously using AsyncDrawFrame(). See PlayAnim for details.

Alternatively, you can also draw individual anim frames by using the DisplayAnimFrame() command. If layers are enabled, it's very easy to show the next frame by just using the NextFrame() command after you have created an anim layer by using DisplayAnimFrame(). See DisplayAnimFrame for details.

Normally, animations contain raster pixel data, but Hollywood also supports special vector animations which consist of vector path data instead and can thus be freely transformed. See Vector anim information for details.


Show TOC