Put object on top

Get help using Construct 2

Post » Sun Feb 05, 2012 5:11 pm

Hello,

I got a simple, but serious for me trouble. When I started to create game I used only one layer. Now it's a time to put a background image. I created new layer at bottom. So after this I got next problem:



Before red square was on top of green object. After adding new layer it looks like this. I tried to use Z-Order: Move on Top for red object, but no any results.

After this I added new action for green object Z-Order: Move to Bottom. Still no result.

Polygon collisions are correct, so red square should be on black line in the middle on green object.

Can somebody help in this situation?alexgold872012-02-05 17:13:43
B
7
Posts: 36
Reputation: 628

Post » Sun Feb 05, 2012 5:23 pm

Please post your capx.

But sounds like both objects are on separate layers, and the layer with the ground on is on top. Click on the layers tab and drag it to the bottom.

B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Sun Feb 05, 2012 5:30 pm

Yes, you are right! When I added new layer I didn't change events and red object spawned at layer #0 which is background. Thank you!
B
7
Posts: 36
Reputation: 628

Post » Sun Feb 05, 2012 5:35 pm

No problem.

Also in future if you plan to move objects around dynamically, and your going to be adding more layers. Instead of setting the layer to its numerical value, set it to its layer name.

For example:

System.onStartOfLayout
     ->Object.MoveToLayer("Background")

So that way if you need to move things around and add more layers its easier
B
29
S
12
G
7
Posts: 740
Reputation: 7,849


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 28 guests