I started a topic yesterday where I had problems using the setFillColor function on display.newText
One reply was a short test code that should work, and it did.
I then found out that my code had once used the “setFillColor” function wrong, and thereafter this function does not work.
This works:
local black = { 0, 0, 0, 1 } local red = { 1, 0, 0, 1 } local tmp = display.newText( "Hi this is a test", display.contentCenterX, 150 ) tmp:setFillColor( unpack( black ) ) timer.performWithDelay( 1000, function() tmp:setFillColor( unpack( red ) ) end)
this (without unpack()) does not work
local black = { 0, 0, 0, 1 } local red = { 1, 0, 0, 1 } local tmp = display.newText( "Hi this is a test", display.contentCenterX, 150 ) tmp:setFillColor( black ) timer.performWithDelay( 1000, function() tmp:setFillColor( unpack( red ) ) end)
I am using Corona SDK - on the Mac: Version 2018.3319 (2018.6.18)