View Single Post
04/28/14, 02:26 PM   #3
GetBackYouPansy
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 7
Originally Posted by Sideshow View Post
Great information! Thanks a lot.
I was wondering, if there is any possibility to alter a timeline animation.
More in detail, I would like to do a translate animation, but the starting coords are not known before the animation is applied to a control. So I would like the animation to take the coords of the control as starting point.
You can get each animation out of the timeline and adjust them. There are shortcuts for the first and last animation, see [1], and you can just do all the animations in the timeline like this.

Lua Code:
  1. -- Increase the duration of every animation in the timeline by 250ms
  2. for i = 1, timeline:GetNumAnimations() do
  3.   local anim = timeline:GetAnimation(i)
  4.   anim:SetDuration(anim:GetDuration() + 250)
  5.  -- what you can do ofc depends on the type of animation!
  6. end

One way you might use this is by creating the timeline from virtual (the virtual being defined in UI XML), with some placeholder durations/positions/whatever, then fill in the actual values, and then run it. For an example in the wild, which the simpler example above is based on, see [2] (Lua) and [3] (XML). The base duration from the XML is bumped up by 250ms for every instance of the timeline, several of which are started in parallel.

[1] http://wiki.esoui.com/Controls#AnimationTimeline
[2] https://github.com/PansyLabs/Timers/...s.lua#L207-211
[3] https://github.com/PansyLabs/Timers/...ers.xml#L70-79

Last edited by GetBackYouPansy : 04/28/14 at 02:39 PM. Reason: Failed to put together a coherent post, like, 6 times.
  Reply With Quote