container and z-order

Discussion and feedback on Construct 2

Post » Tue Nov 18, 2014 5:08 am

Have a simple question - How to get the entire container object along with all its constituent objects to the top of the layer without having to rearrange each of constituent objects again to preserve the same z-ordering between container and its constituents as before?
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Tue Nov 18, 2014 10:27 am

By default, all newly created objects are been created at the top of the layer. However, the constituent elements are indeed not appearing in any predetermined order. You can use the "Move to object" action upon creation to control the z-order between the elements in respect to each other.

See the attached capx for a practical example.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Tue Nov 18, 2014 11:12 am

Hi @eli0s, Thanks a lot for putting this capx file. My question was more around - I have multiple instances of container objects and I need to move the selected container ( along with its constituents) to the top. Everytime I move the container to the top, I am needed to move all its constituents again to the top...I wanted to know if there is an easier way to just move the container and its constituents z-order associated with the container is preserved somehow...
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Tue Nov 18, 2014 8:08 pm

As far as I can understand there isn't a one click way to do it. But you need to set a system that does that only once.

I'm not sure what is it that you have in mind, but I tried to devise a situation that you'll need to move all of the elements of a container at once and change the z-depth at the same time. Check the attached capx. Notice that the tanks, while been dragged, they pop on top of the clouds. When dropped they move behind the clouds.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Wed Nov 19, 2014 12:25 pm

Thanks @eli0s. I was doing it in a similar fashion however I had 6 constituents in the container that I had to move...Was thinking if the container and its constituents could be made as a separate object ( as into a family) and just move the family to the top of the layer...However I gather that the family can only hold objects of similar type ( all sprites or all texts etc.,) and not otherwise. Anyway thanks for your help...BTW, I really liked the code for having the clouds moving...fantastic !
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Wed Nov 19, 2014 8:14 pm

@kmsravindra , you are welcome. I see what you mean. Unfortunately I don't know an other way either. It would be nice indeed if families supported different kind of objects like containers do.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests