The C++ HUD View manages the content HUDKit.swf. Its interface declares the following types:
Note that FxHUDView’s cached MovieClip references are denoted by the MC suffix, short for MovieClip.
During its initialization, FxHUDView registers a reference to every major MovieClip that is changed in UpdateView() at runtime. This is essential for avoiding the retrieval of MovieClip references in every update, thus minimizing the time spent updating the view. The initialization also hides a number of unused UI elements defined in HUDKit.fla.
FxHUDView::UpdateView() updates every element of the view with the data provided by the simulation environment. Its logic is divided into the following sub-methods: UpdateTeamStats(), UpdatePlayerEXP(), Update PlayerStats(), UpdateEvents(), UpdateTutorial(), and UpdateBillboards(). Each of these methods is passed a pointer to the simulation environment which is then used to update the specific UI elements.
Note that MovieClip references are rarely retrieved during an UpdateView() call. Unnecessary MovieClip updates are avoided whenever possible, as updating MovieClips every frame is a potential waste of cycles.
With the Direct Access API, data of any type and form can now be passed efficiently between Flash and the application. The GFx::Value class in particular presents a number of new functions designed to give Scaleform users greater control over Flash content. GFx::Value::SetDisplayInfo(), GFx::Value::GetDisplayInfo() and GFx::Value::SetText() are used throughout the HUD View’s update logic to directly and efficiently manipulate the display state of MovieClips.