WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Frame stuttering while moving in 8.1 vs 8.0 (https://www.wowinterface.com/forums/showthread.php?t=56959)

ircdirk 01-07-19 03:06 PM

Frame stuttering while moving in 8.1 vs 8.0
 
In addon im developing i saw frame stuttering after 8.1 release so i made test. Wrote simple addon and tested it in 8.1 and 8.0.

Here u can see the difference: https://imgur.com/a/vg4X4y1 (top image 8.1 vs 8.0 bottom)

So what did changed in 8.1? Can i do something to make frame moving in 8.1 as smooth as in 8.0?
Or Blizz changed something and i cant do anything about it? :(

Addon source:

Code:

local f = CreateFrame("Frame","AnimationByOnUpdate",UIParent)
f:SetSize(64,64)
local texture = f:CreateTexture(nil,"ARTWORK")
texture:SetAllPoints(true)
texture:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")

f.xpos = 0
f.xoffset = -300
f.speed = 0.01 -- 2=faster, 0.5=slower

local function translate(self,elapsed)
  self.xpos = self.xpos + (self.xoffset*self.speed*elapsed)
  self:SetPoint("CENTER",self.xpos,0)
  if self.xpos < self.xoffset then
    self:SetPoint("CENTER",self.xoffset,0)
    self:SetScript("OnUpdate",nil)
  end
end

f:SetScript("OnUpdate",translate)


Fizzlemizz 01-07-19 03:51 PM

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.

Vrul 01-07-19 05:23 PM

Code:

local f = CreateFrame("Frame","AnimationByOnUpdate",UIParent)
f:SetSize(64,64)
local texture = f:CreateTexture(nil,"ARTWORK")
texture:SetAllPoints(true)
texture:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
texture:SetSnapToPixelGrid(false)
texture:SetTexelSnappingBias(0)

f.xpos = 0
f.xoffset = -300
f.speed = 0.01 -- 2=faster, 0.5=slower

local function translate(self,elapsed)
  self.xpos = self.xpos + (self.xoffset*self.speed*elapsed)
  self:SetPoint("CENTER",self.xpos,0)
  if self.xpos < self.xoffset then
    self:SetPoint("CENTER",self.xoffset,0)
    self:SetScript("OnUpdate",nil)
  end
end

f:SetScript("OnUpdate",translate)


ircdirk 01-08-19 12:42 AM

Thanks for quick response. @Vrul that was the case. Now its like 8.0. Thanks again.


All times are GMT -6. The time now is 08:01 PM.

vBulletin © 2019, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI