It seems as soon as the transition to is called, the ‘onComplete’ of this function is called, ignoring the delay and time properties. Am I doing anything wrong?
Example code below:
-- simple text object local units = display.newText('meter', 100, 100, native.systemFont, 42) -- function to handle transitions local function transitionUnit() -- function to update text local function changeUnitText(theUnit) units.text = theUnit end transition.to(units,{time = 1000, alpha = 0.4,}) -- this transition updates the text before the delay/time expires instead of 'onComplete' transition.to(units,{time = 1000, alpha = 1, delay = 1000,onComplete = changeUnitText('miles')}) end -- tap the text to start the transition. units:addEventListener("tap", transitionUnit)
