First off, I know Corona well, make tutorials lots of folks watch and follow, and can generally figure out a problem with time and patience
This said, the following is driving me bat-sh*t crazy. I’ve got text that is right aligned and when it changes, according to the methodology outlined here:
http://developer.anscamobile.com/reference/index/objectsetreferencepoint
it doesn’t stick to x for the right alignment.
\_W = display.contentWidth;
\_H = display.contentHeight;
local t = {"One", "2Two", "FreeFreeThree", "FourScore", "5"};
local ttl = display.newText("Let's Begin", 0, 0, font, 68\*2);
ttl.xScale = 0.5; ttl.yScale = 0.5;
ttl:setTextColor(255,255,255);
ttl:setReferencePoint(display.TopRightReferencePoint);
function ttl:write(params)
--Store the current X and Y position for use 5 lines down
local \_X = self.x;
local \_Y = self.y;
self.text = params.title;
self:setReferencePoint(display.TopRightReferencePoint);
ttl.x = \_X; ttl.y = \_Y;
end
ttl.x,ttl.y = \_W\*0.5,\_H\*0.5;
local tmr
tmr = timer.performWithDelay(1000, function(e)
ttl:write({title=t[e.count]});
if(e.count == #t) then
timer.cancel(tmr);
tmr = nil;
end
end,#t);
What on earth is wrong here? [import]uid: 7947 topic_id: 14366 reply_id: 314366[/import]

