Hi!
Is it possible to somehow change a display object once it has been created?
Basically I have a simple object like so:
local player = display.newImageRect(“Images/player1.png”, 50,50 );
and a touch event listener associated with it. What I want to do is change player to be a different shape within that touch handler.
I can simply remove the object and create a new one, but I lose the reference in the display group, which I need to keep…
Background: I have three lua files - menu, level and player, and I’m using the director ‘class’ to change scenes. The menu class creates a set number of players (from the player class), and passes them into the new method of the level class as parameters. The level class then creates a display group, and adds the players from the parameters. Passing the display group that is created in the level class starts to get messy at this point…
As you can probably guess, I’m from an OO background, rather than script, so I may be going about this the wrong way
so yeah, any help appreciated…thanks! [import]uid: 131065 topic_id: 23927 reply_id: 323927[/import]