View Single Post
01-07-19, 03:51 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
I'm not sure if this is what you are after but you could give the work to the animation system:
Lua Code:
  1. local f = CreateFrame("Frame","AnimationByOnUpdate",UIParent)
  2. f:SetSize(64,64)
  3. local texture = f:CreateTexture(nil,"ARTWORK")
  4. texture:SetAllPoints(true)
  5. texture:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
  6.  
  7. f:SetPoint("CENTER")
  8.  
  9. f.ag = f:CreateAnimationGroup()
  10. f.ag:SetLooping("REPEAT")
  11.  
  12. local anim = f.ag:CreateAnimation("Translation")
  13. anim:SetChildKey("Move1")
  14. anim:SetOrder(1)
  15. anim:SetDuration(20)
  16. anim:SetSmoothing("IN_OUT")
  17. anim:SetOffset(-200, 0)
  18. f:SetScript("OnEvent", function(self) self.ag:Play() end)
  19. f:RegisterEvent("PLAYER_ENTERING_WORLD")

Change SetSmoothing to "NONE" if you don't want the speed up/slow down at the beginning/end.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-07-19 at 04:06 PM.
  Reply With Quote