Changing Your Score Text

I have gotten my text/score working but it’s static and doesn’t change. I wanted to know how I can change the score to show that an object has hit the bottom of the screen.

Please let me know what I need to do to make this work.

[code]
local scoreApple = display.newText( “”, 301, 19, “Stencil”, 16 )
scoreApple:setTextColor(255, 255, 255)
–Change the value of myText
scoreApple.text = “0”

[import]uid: 59140 topic_id: 12058 reply_id: 312058[/import]

Just bumping this because I moved it from the wrong forum to the right one (this one). [import]uid: 59140 topic_id: 12058 reply_id: 43972[/import]

You need to first set up a way to know when the object hits the bottom of the screen as you describe. From there, you should call a separate function that changes the .text property of your text object to reflect the new score. [import]uid: 52430 topic_id: 12058 reply_id: 43985[/import]

Hey Jonathan thanks for the response. I am still a little bit new to Corona right now but have been learning a bunch. I’ve got a system for detecting when the object reaches the bottom of the screen but I don’t know how to add a separate function that changes my .text property. Help is greatly appreciated. By the way I downloaded your game (which is a lot of fun) with the source files. So if you know where the code is that would help me, let me know! [import]uid: 59140 topic_id: 12058 reply_id: 44259[/import]

You need to have something similar to the line 4 of your code:

scoreApple.text = "0"

To update the score you should use

scoreApple.text = newScore