Animation and the User Interface

Widgets have the ability to be animated. Several of the benefits of this ability include animation states, interactive tooltips and widget movement.

Widget Animation

Widgets have the ability to be animated if they inherit from GmAnimatedWidget. This class adds the ability to store animations for appearing, vanishing, and idling. In addition, the class will store the current animation, allowing the developer to switch between animations using the setEventAnimation call.

Once an animation has been set, the Animated Widget applies the animation transforms. When the animation is complete, it uses the callback function animationFinished to notify the widget which animation has finished running.


Tooltips are available in any Interactive Widget. Once the mouse enters the widget selection space, a tooltip hover counter begins. Once the counter reaches a specified time, the tooltip is drawn at the point where the mouse was detected entering the widget.

The tool tip size and text content is configurable. Using setToolTipText and getToolTipText, as well as setToolTipTextSize and setToolTipEnabled. Using these functions, the developer can utilize any number of tool tip configurations.

Once a tool tip is configured, it can be drawn during a widget's render2d call by using the member function render2dToolTip. This function will handle the time check for hovering and the positioning of the tool tip.

Widget Movement

Widgets can be moved using a combination of the getGLPosition and setGLPosition calls. A widget translated by these calls moves all child widgets with it. These calls are especially useful when you have multiple containers with relative geometry layouts.

Any number of transformations can be applied to a widget. Using the openGL matrices, you can translate, scale and rotate a widget as much as needed. However, movement applied to a widget through these methods may result in undefined behavior, especially in a container class widget with children.