Set Layer Invisible does not work

Bugs will be moved here once resolved.

Post » Sat Jan 16, 2016 4:47 am

Problem Description
I cannot set a layer to be invisible using the event under System, 'Set Layer Visible'

Attach a Capx
https://mega.nz/#!KwFCVBbK!eG4-jSqftOCbPPdozpd0Rr9ROkDgI980zSJr1LxJ_d4

Description of Capx
There are two text objects, one per layer. Layer 1 is by default invisible. When the key V is pressed, if layer 1 is visible, it will become invisible, or if layer 1 is invisible, it will become visible.

Steps to Reproduce Bug
  • Step 1: Preview Layout
  • Step 2: Press V
  • Step 3: Press V again

Observed Result
Upon pressing V the first time, Layer 1 becomes visible, as expected. Upon pressing again, nothing happens.

Expected Result
On the second key press of V, I would expect Layer 1 to become invisible.

Affected Browsers
  • Chrome: YES
  • FireFox: YES
  • Internet Explorer: YES

Operating System and Service Pack
Windows 7, Service Pack 1

Construct 2 Version ID
r216 (64-bit)

Note that on debugging this I found that Layer 1's property 'Visible' is set to false, upon pressing V it is set to 1, and after that it does not change.
B
5
Posts: 20
Reputation: 267

Post » Sat Jan 16, 2016 6:06 am

This is not a bug. It happens because when the layer is visible and you press 'V', the first triggered event evaluates to true, and the layer is set to invisible. Hereafter the second triggered event evaluates to true, and the layer is set to visible again.

The right way to do it, would be to only use one triggered event - like this:

Image

Hope that helps.
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Sat Jan 16, 2016 4:43 pm

Thank you @thegrind, that has fixed my problem.
B
5
Posts: 20
Reputation: 267

Post » Sun Jan 17, 2016 11:48 am

Closing as not a bug
Scirra Founder
B
382
S
223
G
86
Posts: 23,998
Reputation: 189,773


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests