UI Animation System
The UI System and its functionality are no longer supported. Please see the Scaleform GFx documentation for information on the currently supported user interface system.
Overview
The animation system is a powerful and flexible mechanism for manipulating and moving widgets in a scene. This document identifies the major concepts and architecture of the animation system, and explains how the components of the animation system fit together to provide a set of functions for moving widgets.
Terminology
Components
Working with Animation
Basically, UI animations are defined via subobjects declared in the GameUISceneClient class's defaultproperties (which will be referred to as animation templates from here on out). This pool usually contains the animations that are used by multiple widgets or multiple instances of a single widget (such as a scene opening or closing animation). The animation template contains one or more tracks, where each track represents a different value being interpolated (i.e. opacity, position, rotation, etc.). Each track contains one or more keyframes, which define the destination value, how long it should take to reach that value, etc.
To activate an animation, you call the UIScreenObject.PlayUIAnimation() method, passing in a name which matches the 'SeqName' value of the animation template you'd like to activate. To stop an animation, you call StopUIAnimation, again passing in the name of the animation template you'd like to deactivate. Each of these functions also takes an optional animation template reference; the purpose of this parameter is to allow you to define animation templates that will only be used by a single widget type. If there is an animation which is only used by one type of widget, it's not necessary to define it in the GameUISceneClient and add it to the animation sequence pool - you can define it in the widget class's defaultproperties, then pass a reference to that template to PlayUIAnimation/StopUIAnimation, rather than passing the animation template's name.
In other words:
- for global animations which should be accessible to the entire UI, define it the defaultproperties block of your game's GameUISceneClient subclass and add it to the AnimSequencePool array. To activate these animations, pass the SeqName of the template to PlayUIAnimation.
- for custom animations which are only used by one widget type or something like that, define it in the defaultproperties block of that widget class, then pass a reference to that template in the call to PlayUIAnimation.
The UT3 UI code used animations pretty extensively and you should find plenty of examples of how to use it in that code by searching the script source for PlayUIAnimation.