I've been out of town camping for the past week, and so I haven't had much quiet time with my compiler lately. However, right before I left I managed to finish up a small text animation system for my text entity classes. The way that my engine handles text is to create a 'TextEntity2D' which allows for setting all of the normal properties (size, color, position, font, etc...) and can be integrated into my scene graph implementation. This allows for easy control over objects that have both 3D representations as well as text associated with them.
To allow for things like fading colors in and out, or having the text scroll to somewhere else, or manipulating any of the other properties mentioned above, I turned to the standard 'Controller' system that I adopted from the Wild Magic engine long ago. The controller attaches to an entity and modifies it's parameters in some time oriented fashion. In general, you create a new type of controller when you want to implement special or new functionality. However, I wanted to have the animation states to be dynamically requested, and not key framed or something like that - basically I don't want to have to load animations from file, but rather control then through my scripting interface instead.
The solution was to have the controller receive events which are sent by the scripting functions that request a state. The state contains information about how long to interpolate between the current state and the next state, as well as any new property values that are desired. So regardless of the current state of the text entity, I can call a scripting function with the desired new state information and the time to get to it, and then it will send a message to the controller and take the appropriate action to get to the new state.
The best part about this system is that it utilized all completely existing functionality - namely the scripting manager (indirectly by running a script, and directly by registering function interfaces for sending events), the event manager (for sending the events themselves), and the controller system (to implement the requests). It's nice to add functionality without adding tons of new code to work through and test [grin]!
Another nice feature is that I use a queue in the controller to allow a 'burst' of states to be requested. So if you want the text to move in a circular fashion you could send eight messages, each one 1/8 of the way around a circle, and then controller would process each request in turn - giving the rotation effect that I wanted. Overall, the system works quite well - although there isn't much of a chance for screenshots of an animations system like this [sad]. Even so, it works well and I can move on to adding similar functionality to the 3D entities as well.