Thread Tools Display Modes
01-07-19, 03:06 PM   #1
ircdirk
A Molten Giant
 
ircdirk's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 823
Question 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)

Last edited by ircdirk : 01-07-19 at 03:11 PM.
  Reply With Quote
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
01-07-19, 05:23 PM   #3
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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)
  Reply With Quote
01-08-19, 12:42 AM   #4
ircdirk
A Molten Giant
 
ircdirk's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 823
Thanks for quick response. @Vrul that was the case. Now its like 8.0. Thanks again.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Frame stuttering while moving in 8.1 vs 8.0

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off