destroy or set invisible for a popup menu which is better

Discussion and feedback on Construct 2

Post » Sun Nov 29, 2015 10:38 am

two layer on each of the layout, the top layout have the popup menu on game on the bottom one.
lets say you have 50 level each time player win a game a menu with
Back, replay and next button popup in the middle of the screen...
set invisible

is it better to set the layer invisible on start of layout and set visible when game ends..
Pros is:- it works
Cons is:- Back, replay and next button still press although the layer is invisible
maybe:- this method takes up memory why i am asking you guys
fix to touch issue is:- put Back, replay and next button in a group on set group deactivated on reactivate when win

is it better to put it off screen set destroy outside and spawn it when the player wins a level
pros is:- i am just asking before i waste my time to try this one
cons is:- ...
maybe: this method save memory and cpu usage
Posts: 67
Reputation: 719

Post » Sun Nov 29, 2015 2:50 pm

One of my beta testers just found this same bug in my app. Even though the button was invisible, he could still click on it. My solution, rather than go through the whole process of destroy, create, move... I just disabled the button.
Posts: 132
Reputation: 2,108

Post » Sun Nov 29, 2015 4:45 pm

you could just add a condition to the button event "button/layer/etc. is visible", then the event only fires when you want it to ;)
Posts: 485
Reputation: 5,365

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests