Rapidly change the text color

Hello,

How can I rapidly change the text color? I have tried this method,but it only changes the color once,and it stays like that.

This thing would be really simple to do if we would have threads or delays (I am not talking about timer.performWithDelay() function,but actual delays,or sleep methods)

Thanks! 

Bob

local colorTable = {0,1,1,1,0,1,5,0,2,0} for i = 1,#colorTable do for k = 2,#colorTable do for j = 3,#colorTable do gameOverText:setFillColor(colorTable[i],colorTable[k],colorTable[j]); end end end

Hi.

You can do what you ask, though you need to embed the code in a coroutine, e.g. using something like this.

With that, along with one of the wait functions further down, your code would look like:

CoroPerformWithDelay(10, function() -- underlying timer with 10 ms granularity local colorTable = {0,1,1,1,0,1,5,0,2,0} for i = 1,#colorTable do for k = 2,#colorTable do for j = 3,#colorTable do gameOverText:setFillColor(colorTable[i],colorTable[k],colorTable[j]); WaitMS(20) -- wait between color changes end end end end)

http://github.com/roaminggamer/SSKCorona/blob/master/ssk/extensions/transition_color.lua

Hi.

You can do what you ask, though you need to embed the code in a coroutine, e.g. using something like this.

With that, along with one of the wait functions further down, your code would look like:

CoroPerformWithDelay(10, function() -- underlying timer with 10 ms granularity local colorTable = {0,1,1,1,0,1,5,0,2,0} for i = 1,#colorTable do for k = 2,#colorTable do for j = 3,#colorTable do gameOverText:setFillColor(colorTable[i],colorTable[k],colorTable[j]); WaitMS(20) -- wait between color changes end end end end)

http://github.com/roaminggamer/SSKCorona/blob/master/ssk/extensions/transition_color.lua