Talk:API Region SetPoint
From WoWWiki
It seems to me that the variant
obj:SetPoint(point);
is not working.
The others do work for me.
Maisha
- "not working" meaning what, exactly? Posted by: EGingell (talk | contribs) on 07:49, 24 February 2009 (UTC)
- *not expecting an answer since this was posted almost 3 years ago*
Re: exponential-time increase
This has either been fixed or was unsubstantiated. The following executes in 0.002~ seconds. Creating 50 chained frames takes 1/10000 as long as the author of the example code on the article page claims it takes for 25. I even tried it without making the variables local (it actually took less time using global variables).
local startTime = GetTime()
local NUMFRAMES = 50
local first = CreateFrame("Frame", UIParent);
first:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", 700, 500);
first:SetWidth(100);
first:SetHeight(10);
local prev=first;
local f
for i=1,NUMFRAMES do
f = CreateFrame("Frame", UIParent);
f:SetPoint("TOPLEFT", prev, "BOTTOMLEFT", 0, -2);
f:SetPoint("TOPRIGHT", prev, "BOTTOMRIGHT", 0, -2);
f:SetHeight(10);
prev=f;
end
local endTime = GetTime();
print(endTime - startTime) -- prints 0.0019999999931315 for NUMFRAMES = 50 and 0.00099999998928979 for NUMFRAMES = 25
Posted by: EGingell (talk | contribs) on 07:49, 24 February 2009 (UTC)
