local textObject = display.newText( "Hello World!", 100, 0, nil, 24 ) textObject:setTextColor( 0,255,255 ) local button = display.newImage( "buttonBlue.png" ) button.x = display.stageWidth / 2 button.y = display.stageHeight - 50 function button:tap( event ) local r = math.random( 0, 255 ) local g = math.random( 0, 255 ) local b = math.random( 0, 255 ) print(r.." "..g.." "..b) transition.to( textObject, { time=1000, y=textObject.y+100 } ) textObject:setTextColor( r, g, b ) end button:addEventListener( "tap", button )
Button is working, animation is working But the text color is not changing.
I just read a pdf tutorial to text the helloworld. Why is it not working?