In the code below when tally(hit) calls the tally function a counter number is displayed BUT when the function is called again the previous number does not disappear but rather is displayed on top of the previous number.
for example at first 1 is displayed but when it is time to display 2 it is put on top of 1. How can I display the numbers one at a time so the user would see a counter 1 then 2 etc.
function tally (score)
local t = display.newText(“0” , 90, 15, “ArialRoundedMTBold”, 20 )
t:setTextColor( 250, 250, 250 )
t.text = score
end
–***********************
hit = hit + 1
It’s because you keep calling newText() inside the function. Call it just once at the top of your code and don’t keep creating it over and over. [import]uid: 12108 topic_id: 6376 reply_id: 22045[/import]