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 have to set the FromDisk tag to True in LoadAnim() or the @ANIM preprocessor command. It is recommended to always stream larger animations because buffering them 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 LoadAnim() 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.


Show TOC