How do I Show and Hide Menu

Get help using Construct 2

Post » Sun Apr 27, 2014 9:00 pm

Hello!
I am trying to show and hide a menu while the game is running. The thing is that the images aren't changing everytime the player is touching the sprites. Seems like some spots on the image aren't sensitive to touch. Perhaps the PNG alpha? Once in a while it does work.

I have attached an image of the eventsheet.

Thanks!
You do not have the required permissions to view the files attached to this post.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Sun Apr 27, 2014 9:25 pm

Hence, the images are on top of each other, same layer.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Sun Apr 27, 2014 9:52 pm

The sprites are still there, whether they are visible or not, so they are both getting the touch event. You are better off using frames on one sprite and changing the frames.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
249
Posts: 3,764
Reputation: 138,579

Post » Sun Apr 27, 2014 10:18 pm

Hi Blackhornet! Thanks and it really works. But... what if I have menu-itens while the menu is on?
Tried that.. but if I touch, for instance, the Music button, the music event is triggered and the menu frame also changes.
You do not have the required permissions to view the files attached to this post.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Sun Apr 27, 2014 10:53 pm

You just need to combine the actions and check more state to process and ignore as appropriate.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
249
Posts: 3,764
Reputation: 138,579

Post » Mon Apr 28, 2014 12:55 am

Followed your example. But what if Sprite2 (the blue one) is also used to go back to the previous stage?
Cause in your example "SoundOnOff" are not overlapping "Sprite2". You are using an external button to show/hide the menu.

In my project I have 3 buttons and 2 menu sprites. If only I could disable objects or enable sprites to catch touches following Z order as priority.
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Mon Apr 28, 2014 1:02 am

henriquesv wrote:Followed your example. But what if Sprite2 (the blue one) is also used to go back to the previous stage?
Cause in your example "SoundOnOff" are not overlapping "Sprite2". You are using an external button to show/hide the menu.

In my project I have 3 buttons and 2 menu sprites. If only I could disable objects or enable sprites to catch touches following Z order as priority.


Well, you could just make 4th button that would be opening and closing the menu, where the arrow in your examples is. Simple, and actually more ux friendly.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
92
S
30
G
22
Posts: 1,987
Reputation: 20,178

Post » Mon Apr 28, 2014 1:08 am

You're right Megatronx! Why make it easy if we can make it harder? lol .. keep it simple! =)
Thank you guys!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827


Return to How do I....?

Who is online

Users browsing this forum: Pandy, Uglypenguin and 8 guests