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

destroy
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
B
9
S
2
Posts: 66
Reputation: 717

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.
B
15
S
5
Posts: 124
Reputation: 1,687

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 ;)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340


Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot], snafu79213 and 7 guests