Does touch action work on invisible layer ?

Just started using Construct 2? Post your questions here

Post » Tue Jul 12, 2016 1:54 pm

So if i create a layer with some sprites with touch functionality and i set it invisible during gameplay . Can the sprites be affected if i touch them while the layer they are in is invisible ?

If touching those sprites does works , is it possible to deactivate the touch of all the layer ?
'Image'Image'Image
B
18
S
5
G
2
Posts: 96
Reputation: 2,347

Post » Tue Jul 12, 2016 5:20 pm

Touch does work if it's invisible. What you can do is put all of all the sprites into a family. Create a condition that states when the layer is invisible, disable collisions on the family (this will prevent touch from working) and when visible enable collisions on the family.

Hope this helps
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Mon Jul 18, 2016 1:54 am

Don't think you need a family for that necessarily. Add a condition to test if layer is visible. Can use object.layerName if layer may vary.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Sun Jul 24, 2016 8:45 pm

badmoodtaylor wrote:Don't think you need a family for that necessarily. Add a condition to test if layer is visible. Can use object.layerName if layer may vary.

Interesting , simple ... didn't think about it ! I will keep this in mind , Thanks !!
'Image'Image'Image
B
18
S
5
G
2
Posts: 96
Reputation: 2,347


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest