Objects with dynamically-updated numbers displayed on them

For a game I have in mind I want to have objects with a solid color fill and a number. The objects need to interact via the physics engine, and both the fill color and the number on an object can change as the game progresses. This isn’t what I’m doing but consider for example the IOS game Hundreds:
http://playhundreds.com/presskit/images/presskit/level61.png
What I have in mind isn’t anything like that game but if I could do that, I could implement what I have in mind.

I’ve tried creating objects with display.newRoundedRect, which works fine, but then I can’t seem to find a way to use .text to set any text on it. And even if I could, I don’t see a way to set the font, etc. Am I just looking in the wrong direction here? Any help would be appreciated! [import]uid: 215993 topic_id: 35135 reply_id: 335135[/import]

You’ll use display.newRoundedRect to create the object and then display.newText to create the text. That text object will have a .text property you can use to change the string value (and display.newText allows you to set the font, size, etc.)

So you can move both objects or add them both to a display group and then just move that display group and both objects will move as one.

Jay [import]uid: 9440 topic_id: 35135 reply_id: 139671[/import]

Awesome, thanks! [import]uid: 215993 topic_id: 35135 reply_id: 139672[/import]

You’ll use display.newRoundedRect to create the object and then display.newText to create the text. That text object will have a .text property you can use to change the string value (and display.newText allows you to set the font, size, etc.)

So you can move both objects or add them both to a display group and then just move that display group and both objects will move as one.

Jay [import]uid: 9440 topic_id: 35135 reply_id: 139671[/import]

Awesome, thanks! [import]uid: 215993 topic_id: 35135 reply_id: 139672[/import]