[Solved] How do I fix a sort Z order for a Sprites family

Get help using Construct 2

Post » Fri Aug 19, 2016 7:17 am

This is what i'm trying to do:
Image

I not understand very well how the Sort Z order works for instances.

When a Circle is created gets a Zorder number. With the mouse wheel you can add/substract this number to get higher/lower to make the sprite be in front or behind others. Each move of the wheel make a "sort Z order by the Zorder instance variable" but seems i'm doing something wrong :S .

Here is the capx:
https://dl.dropboxusercontent.com/u/659 ... am_p8.capx


Create a circle and click the button "light" to see better if they are front or behind others.
Last edited by matriax on Fri Aug 19, 2016 6:08 pm, edited 1 time in total.
B
24
S
10
G
3
Posts: 553
Reputation: 4,483

Post » Fri Aug 19, 2016 4:01 pm

I realize that i can get the Zindex of an object in a layer but i can only move to Bottom/Top.

There is no way to change the Zindex of an objcet in 1/-1 insted only front/back?

I can get this sorter Z order working.

I simply want that using the mouse wheel change the Zindiex of an object in 1/-1 to put the sprite in front o back others.
B
24
S
10
G
3
Posts: 553
Reputation: 4,483

Post » Fri Aug 19, 2016 6:08 pm

Well, i finally solved it. I put the Sort Z order out the action of the wheel mouse and now works perfect.
B
24
S
10
G
3
Posts: 553
Reputation: 4,483

Post » Fri Aug 19, 2016 8:43 pm

I was making you an example for you. And i had the same problem as you do. Bringing the z order out of the wheel event did not even help.

https://www.dropbox.com/s/00qwl4huonuxj ... .capx?dl=0

@Ashley Seems like Z order sorting does not trigger a redraw when the sprites have a zero animation speed.
Delete sprite 7 (the only animating sprite) in above project, and Z order does not update in the viewport.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 19, 2016 9:24 pm

If there's a problem please file a bug report following all the guidelines.
Scirra Founder
B
397
S
236
G
88
Posts: 24,420
Reputation: 194,549


Return to How do I....?

Who is online

Users browsing this forum: richardfu and 35 guests