i have this code set off by a widget button named goBtn
it keeps displaying the new randomly generated number over the old one for some reason rendering it unreadable most of the time
thanks
[lua]
local playedOnce = false
local function ongoBtnPress()
local color = math.random( 5 )
if playedOnce == false then
local displayedColor = display.newText(color, 300, 20, native.systemFont, 40)
displayedColor:setTextColor(255, 255, 255)
local playedOnce = true
else
displayedColor:removeSelf()
local displayedColor = display.newText(color, 300, 20, native.systemFont, 40)
displayedColor:setTextColor(255, 255, 255)
return true
end
end
[/lua]