How to move object to top layer?

Get help using Construct 2

Post » Sat Mar 03, 2012 1:05 pm

Sorry if this was asked before, I searched and couldn't find it.

Is it possible to move an object to the top layer (regardless of how many layers are on the layout)? Not to top of its current layer, but to the top of the top layer.

Thanks.
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Sat Mar 03, 2012 1:24 pm

Name your top layer "Top Layer" or whatever.

On event: move object to layer "Top Layer". (There's an action 'move to layer')

I think it automatically goes to the top.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Mar 03, 2012 1:27 pm

Thanks sqiddster. I did think of that. This is the workaround I will implement unless someone has another suggestion?
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Sat Mar 03, 2012 6:35 pm

you can always keep a global variable with the name or number of your top layer and use it instead of hard coding.
I guess that if you're asking that, you might have many object that needs to switch to this layer and don't want to change the events every time you change your layer structure.
That's the only issue I see about not having a system variable or way to find it out.
So yeah, I would use a global variable.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Mar 04, 2012 8:12 am

Thanks Yann. I ended up using a similar workaround. Would be nice to have a system way to find out, something like "numberOfLayers" would be great

Cheers!
B
14
S
5
G
7
Posts: 235
Reputation: 5,175


Return to How do I....?

Who is online

Users browsing this forum: currypuff, makotto, Yahoo [Bot] and 23 guests