Please Add: Send Forward/Send Backward Commands...

Discussion and feedback on Construct 2

Post » Wed Feb 13, 2013 4:22 pm

What might be nice for the family issue is a for each object in layer.
If it was possible to group dissimilar objects like that.
Basically:

For each object on layer 0, ordered by self.y, send to front.

Any thoughts @Ashley, or were you planning on going with an index at some point?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Feb 13, 2013 4:34 pm

Hopefully we'll be adding better Z order controls for both the editor and runtime in future.

@C-7 - families work great AFAIK and don't have any issues with for-each. You might want to make a post to the bugs forum if you think there is a problem.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 13, 2013 7:43 pm

Good to hear Ashley!
Also I can confirm "for each families" do work for me

@Mr E Bear I need to have everything on the same layer because there's an effect applied to it, and I can't apply it on several layers for both performance and the look I'm after
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Wed Feb 13, 2013 10:35 pm

[QUOTE=Ashley] Hopefully we'll be adding better Z order controls for both the editor and runtime in future.

@C-7 - families work great AFAIK and don't have any issues with for-each. You might want to make a post to the bugs forum if you think there is a problem.[/QUOTE]

@Ashley Do they allow more than one object type? They work fine if you build your entire level out of one object type. I never said there was a bug, just that it is severely limiting. I can only z-order based on y by either hackishly using an array (which it seems I may have to resort to), or using Rex's plugin that does it by layer. But with the plugin, I can't exclude anything.

If I'm using a spriter object, for instance, it will shuffle the objects in with everything else as opposed to keeping them relative to the scml object. So I can't use a family and include the objects I want because I use both tiled backgrounds AND sprites (and scml, but that's beside the point). And I can't simply use the plugin because the spriter body parts are z-ordered with everything else.

It could at least be gotten around with "move forward"/"move backward", but there is no really usable solution to this, to my knowledge, unless I essentially load all y values into an array every tick or so, sort it, and z-order based on that.
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

Post » Wed Feb 13, 2013 10:58 pm

Hi, I am the original poster. Better z order controls in next release would be great! - Just need "Bring Forward"/"Send Backwards" commands to be added to the IDE, thanks! - JeZ+Lee
B
11
S
3
G
4
Posts: 105
Reputation: 2,950

Post » Thu Feb 21, 2013 2:52 am

Just thought of a couple things that might help for now, and it's not too hard to do.

Pick all the instances, sort by position (X/Y), and bring the highest/lowest to the top/bottom as desired.

Give instances a variable that denotes their "depth" and you can then arrange the Z-order on the fly by comparing the "depth" variable.

@Ashley, that might be a very simple way to implement Z-ordering: a built-in depth variable.
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests