Set Z-index

Discussion and feedback on Construct 2

Post » Thu Sep 17, 2015 12:42 pm

Hello,

@Ashley

currently there are only "bring to top/bottom" actions, but it's not possible to set a specific Z-index on runtime. Actually, it's a very crucial (basic) feature and it surprises me that it is missing.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Thu Sep 17, 2015 12:46 pm

There's a "move to object", with option to place in front or behind another item.
Image
Game Producer & Independent Developer - http://raphaelgervaise.com
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Thu Sep 17, 2015 1:21 pm

I know, but it is something different. In this case in order to set a specific Z-index, I have to remember what object it was infront of, but if the object was destroyed on runtime - it's very inconvinient this way and there are a lot of edge cases. Picking/comparing objects within one family is also problematic.
B
45
S
11
G
4
Posts: 517
Reputation: 7,393

Post » Thu Sep 17, 2015 6:11 pm

Yea, I agree, this would be a useful feature.
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949

Post » Fri Sep 18, 2015 9:25 am

there should be dynamic z-indexing which i am missing.
example - you have a house. when you character is behind the house - set the index to be behind the house, but when > 50% of Y (you get in front of the house) then set the index to be infront of the house.
it would help with 2.5D games / isometric.

also i hate how you have to change that all the time - example - i set that my mines for example have index 1
and then i create a character with index 2. but if i again create a mine - she doesn't have default index 1, gets index 3 and is above both of the last objects which makes it wtf. i would recommend that you add a "default zindex" property @Ashley (thnx)
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
42
S
14
G
12
Posts: 624
Reputation: 9,421

Post » Fri Sep 18, 2015 1:08 pm

I think the best approach would be to have a "sort Z indices by instance variable" action. I don't think dealing with Z indices themselves is very intuitive because they depend on how many objects are underneath (creating and destroying instances changes the Z index of everything above it). Then you can just have a number which does not have to be incrementing or any particular number at all, just something to sort it relative to other objects.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Fri Sep 18, 2015 9:02 pm

I agree that there shoud be z-index option by default, and I hope c3 will include that feature, however you still can do it efficiently with events, sorted by Y axis. You can narrow it down to specyfic objects. You can make it a function that you call every time you need to z-order everything.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Sep 19, 2015 2:08 pm

@Ashley - i agree about the sorting problem because you can't determine how many objects is nested under each object and so on.. but at least give us a "default" z-index on each instance, this shouldn't be hard (i presume) to implement and it could hit next stable. thnx
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
42
S
14
G
12
Posts: 624
Reputation: 9,421


Return to Construct 2 General

Who is online

Users browsing this forum: Huemerson and 13 guests