Subject: Update sequence of Text Object properties make difference
Corona Version: 0.5 Build 2009.10.15.1 / Simulator Version 0.3
System Version: 10.5.8
HW Info (your computer specs): 2 GHz Intel Core Duo 4GB Memory
iPhone/iPod generation: iPod Touch 2nd Gen
iPhone/iPod firmware version: 3.1.2
Severity - 1 Showstopper(crash), 2 Critical(hang or failure), 3 Important(doesn’t function as planned),
4 (annoying/aesthetic), 5 (N/A): 3
Reproducibility (Every time, intermittent, only happened once, n/a): Every Time
Description:The order in which Text Object properties get updated produce different results
Steps to reproduce (keep this as simple as possible):
- Run the below code. The text slides across screen (NOTE the order in which the Text object properties are updated):
local txt = display.newText( "", 0, 0, nil, 10 )
txt:setTextColor( 255,255,255 )
local function onEnterFrame( event )
txt.x = txt.x + 1
txt.y = txt.y + 1
txt.text = event.time -- this is done last: prior updates have effect
end
Runtime:addEventListener( "enterFrame", onEnterFrame )
- Run the below code. The text DOES NOT slide across screen (NOTE the order in which the Text object properties are updated):
[code]
local txt = display.newText( “”, 0, 0, nil, 10 )
txt:setTextColor( 255,255,255 )
local function onEnterFrame( event )
txt.text = event.time – this is done first: subsequent updates ignored
txt.x = txt.x + 1
txt.y = txt.y + 1
end
Runtime:addEventListener( “enterFrame”, onEnterFrame )
[/code] [import]uid: 1581 topic_id: 186 reply_id: 300186[/import]