Changed up the animations a bit and added more dynamics, specifically by resembling Winamp's AVS plugin's Superscope element a little more.
You have 3 scripts to define:
This will be called when the module is enabled.
This will be called when the GameTooltip is anchored, right before SetUnit() is called.
This morning's tag introduces custom animations. The default animation just causes the tooltip to circle around the mouse pointer.
Called at every position refresh.
In your animation script you're assigning two variables -- x and y. You're dealing with a graph, top-left-most being -1,-1 and bottom-right-most is 1,1. Consider 0,0 being mouse cursor center.
All math functions are available, plus a few utilities to make working on the graph a little more practical.
You have: isnonzero(x) which will return 1 if non-zero, 0 otherwise.
You have: signmoid(a, b) which I have no idea what good it may be. o.O
You have: above(val1, val2) which will return 1 if val1 > val2, 0 otherwise.
You have below(val1, val2) which will return 1 if val1 < val2, 0 otherwise.
Yuu have if2(bool, a, b) which if bool is equal to 1, then 'a' is returned, otherwise return 'b'.
You have: sign(v) which returns -1 if v is negative, 1 if positive, 0 otherwise.
You have: equal(a, b) which returns 1 if a == b, or 0 if otherwise.
If you haven't noticed, 1 is a true boolean, and 0 is a false boolean under this animation scope. This is all inspired by Winamp's old AVS plugin, and these functions come from that plugin's script environment.
This will be called at every animation point, or every tooltip position refresh. You assign 'x' and 'y' here usually.
You have the original 'i' variable to access, but you also have 'v' which is a really tiny random number that increments. It's supposed to be a stand-in for music waveform data.
The run environment inside the Position module is isolated, meaning it's not StarTip.environment, but is local to the module itself. Note that the animationPoint script is performed after the anchor script is ran, e.g. one out of anchorScript, inCombatScript, unitFramesScript, and otherScript.
I'll likely make it to where you can create multiple animations to choose from, so there can be some presets.
I also made an option to toggle animations off all together.