How do I Destroy a Sprite then bring it back?

Just started using Construct 2? Post your questions here

Post » Fri Jun 17, 2016 4:56 am

So I have my main menu for a touch screen mobile game all on a separate layer names gui. At first I have been simply making the buttons visible when a player clicks on the menu button, and invisible when the click the exit sprite. But I have run into a problem. If I touch the part of the screen where the buttons are(even when set to invisible) the button gets clicked and the menu event is ran. So I have found that destroying the sprites will prevent this from happening and save cpu. But then how do I call the objects back into play when the player hits the menu button? I tried setting the obj sprite to visible to show them again, but once they are destroyed the visible setting does not work.
Image
B
35
S
13
G
3
Posts: 47
Reputation: 3,934

Post » Fri Jun 17, 2016 5:01 am

Or should I just create a new layout for this and call the layout when a player touches the menu button?
Image
B
35
S
13
G
3
Posts: 47
Reputation: 3,934

Post » Fri Jun 17, 2016 5:38 am

A common method is to put your menu events in a Group, then enable/disable the group to turn the events on and off as needed.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Fri Jun 17, 2016 6:04 am

Thank you so much! worked very well for me!
Image
B
35
S
13
G
3
Posts: 47
Reputation: 3,934


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest