Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-04-22, 04:05 PM   #1
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
Rotation animations in Dragonflight

I'm having problems with a personal project that was working just fine in 9.1, involving animations, specifically rotation.

It seems to me that the :SetOrigin function works very differently than before or is broken in some way, here is a reproducer:

Code:
local duration = 2.0;
local width = 50;

local center = CreateFrame("frame", UIParent);
center:SetPoint("CENTER", 0, 0)
center:SetSize(2, 2);
local centerTex = center:CreateTexture();
centerTex:SetColorTexture(1, 0, 0, .9);
centerTex:SetAllPoints(center);

local frame = CreateFrame("frame", UIParent);
frame:SetPoint("LEFT", UIParent, "CENTER", 0, 0)
frame:SetSize(width, width * 2);

local tex = frame:CreateTexture();
tex:SetColorTexture(0, 1, 0, .2);
tex:SetAllPoints(frame);

local ag = frame:CreateAnimationGroup();

local rot0 = ag:CreateAnimation("Rotation");
rot0:SetDegrees(45);
rot0:SetDuration(duration);
rot0:SetEndDelay(duration);
rot0:SetOrigin("LEFT", 0.1, 0); -- try -.1, 0, .1
rot0:HookScript("OnFinished", function(...) ag:Pause(); end);

print("Scale: ", frame:GetEffectiveScale());
ag:Play();
See the line "rot0:SetOrigin("LEFT", 0.1, 0); -- try -.1, 0, .1", and I'm already very conservative with those values here, using 1 or -1, the texture is off-screen in half a second. Also it prints "Scale: 1"

Any ideas what's going on here would be appreciated
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Rotation animations in Dragonflight


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