How to set Z order?

Get help using Construct 2

Post » Thu Nov 24, 2016 2:31 am

Hi there, I had two objects, A and B. A is on top of B, but I wanted B to be on top of A, to do that, I tried moving B on top of A on Z Order Bar, but when I test the layout, it din work.

Then, I tried creating instance variable for both of the object,

A's instance variable : sortorder = 2
B's instance variable : sortorder = 1

On event sheet,

On A created, System Sort A Z order by sortorder
On B created, System Sort B Z order by sortorder

But it din work also, help please..
B
48
S
20
G
6
Posts: 72
Reputation: 6,472

Post » Thu Nov 24, 2016 6:11 am

You can simply create an event, at start of layout -> Z Order, Move To Object. Then you choose if you want that object above or below the other one.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Thu Nov 24, 2016 1:08 pm

Changing them in the Z-order bar should have worked just fine, unless you're creating B first, then A in your events.
The last object created will always be on top, so you'll have to send it to back or re-order it using code if that's what you want.
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Thu Nov 24, 2016 3:02 pm

You need make a Family and sort by event. here the example and capx file.

Image

he the capx file:
https://drive.google.com/file/d/0B9uHUU ... sp=sharing
B
48
S
9
G
10
Posts: 200
Reputation: 8,258

Post » Mon Nov 28, 2016 4:24 am

Whao, thanks guys! I have tried all of the method, it works great!
B
48
S
20
G
6
Posts: 72
Reputation: 6,472


Return to How do I....?

Who is online

Users browsing this forum: evillair, lordsas, Matei511, tarek2 and 64 guests