Name
SelectAnim -- select animation frame as output device (V4.5)
Synopsis
SelectAnim(id, frame[, mode, combomode])
Function
This function selects the specified animation frame as the current output device. This means that all graphics data that is rendered by Hollywood will be written to this animation frame. You have to specify an animation identifier as well as the single frame that shall be used as output device.

The optional mode argument defaults to #SELMODE_NORMAL which means that only the color channels of the anim will be altered when you draw to it. The transparency channel of the anim (can be either a mask or an alpha channel) will never be altered. You can change this behaviour by using #SELMODE_COMBO in the optional mode argument. If you use this mode, every Hollywood graphics command that is called after SelectAnim() will draw into the color and transparency channel of the anim. If the anim does not have a transparency channel, #SELMODE_COMBO behaves the same as #SELMODE_NORMAL.

Starting with Hollywood 5.0 you can use the optional combomode argument to specify how #SELMODE_COMBO should behave. If combomode is set to 0, the color and transparency information of all pixels in the source image are copied to the destination image in any case - even if the pixels are invisible. This is the default behaviour. If combomode is set to 1, only the visible pixels are copied to the destination image. This means that if the alpha value of a pixel in the source image is 0, i.e. invisible, it will not be copied to the destination image. Hollywood 6.0 introduces the new combomode 2. If you pass 2 in combomode, Hollywood will blend color channels and alpha channel of the source image into the destination image's color and alpha channels. When you draw the destination image later, it will look as if the two images had been drawn on top of each other consecutively. Please note that the combomode argument is only supported together with #SELMODE_COMBO. It doesn't have any effect when used with the other modes. Please note that the combomode argument is only supported together with #SELMODE_COMBO. It doesn't have any effect when used with the other modes.

An alternative way to draw into the transparency channels of an anim is to do this separately using SelectMask() or SelectAlphaChannel(). These two commands, however, will write data to the transparency channel only. They will not touch the color channel. So if you want both channels, color and transparency, to be affected, you need to use SelectAnim() with mode set to #SELMODE_COMBO.

When you are finished with rendering to your animation and want to use your display as output device again, just call EndSelect().

Note that you must not call any commands which modify your animation while it is selected as the output device. Specifically, you must not call ScaleAnim(), FreeAnim(), or ModifyAnimFrames().

Only commands that output graphics directly can be used after SelectAnim(). You may not call animated functions like MoveAnim() or DisplayBrushFX() while SelectAnim() is active.

This command works only with animations buffered entirely in memory. You cannot use it for animations that are played directly from disk.

Inputs
id
animation which shall be used as output device
frame
frame of the animation that graphics shall be drawn to
mode
optional: rendering mode to use (see above); this can be either #SELMODE_NORMAL or #SELMODE_COMBO; defaults to #SELMODE_NORMAL
combomode
optional: mode to use when #SELMODE_COMBO is active (see above); defaults to 0 (V5.0)
Example
SelectAnim(1, 5)
SetFillStyle(#FILLCOLOR)
Box(0, 0, 320, 256, #RED)
EndSelect()
The code above draws a 320x256 rectangle to frame number 5 of animation 1.

Show TOC