Layer Numbering Movment

Discussion and feedback on Construct 2

Post » Wed Feb 01, 2012 5:07 am

I had to move some layers around in a project to make room for another layer underneath and found that this messed up most of my code which referenced layers.

The code referenced my HUD on layer 3 but I had to move the HUD to layer 4, but all the code was still referencing level 3.

I've noticed how if you change the name of a variable it will automatically change the name everywhere else (which is fantastic) and I was thinking it would be a really useful to make it track which layer it is referencing in the same way
B
21
S
7
G
3
Posts: 33
Reputation: 4,522

Post » Wed Feb 01, 2012 7:41 am

You an use the. And of the layer instead of the number so then It looks for the layer name fixing the issue.
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Wed Feb 01, 2012 1:31 pm

Just use the layer name instead of the number, e.g. "HUD" instead of the number 4, then it will always use the same layer regardless of where it is.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Feb 02, 2012 7:20 am

Ah cool, Thankyou for that. That's even more flexible than I thought then.
B
21
S
7
G
3
Posts: 33
Reputation: 4,522


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests