Problem transitions between layouts

Get help using Construct 2

Post » Mon Feb 01, 2016 3:26 am

Message: GuyManDude can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Howdy folks. I need help figuring out why when moving from one layout to another, the transition seems to work fine the first time but the second time the layers are getting rendered out of z order and with parallax disabled.

If you take a look at the linked capx file, start the project from Floor2 and then click the laptop button that appears on the HUD layer. That opens the Laptop layout. Click the red X to close the Laptop layout and it will send you back to the Floor 2 layout. Click the laptop again and once again close it. This time you see the HUD seems to be missing. If you move the player to the top left corner of the map you can see the HUD sprite in the background but it's behind some layers. It needs to on top and should stay in place when moving the player around like it does when you start the game.

http://1drv.ms/1P7oTAO

Thanks for taking the time to read my post. I appreciate any help you can offer.
B
8
S
1
Posts: 27
Reputation: 515

Post » Tue Feb 02, 2016 1:36 am

If I start the game in the Laptop layout and close it out, it loads up the Floor2 layout fine. But if I start it in Floor2, go to the laptop layout and close it out, the transition back to Floor2 exposes the problem.

A look at the debug output shows the layer index numbers are not changing but the Z index when rendered seems to be changing. How can i check the rendered Z indexes?

Please help, I cannot progress any further without solving this problem. I plan to have more of these type transitions and I must know how to fix them to make it worth spending any more time on this project.

TIA
B
8
S
1
Posts: 27
Reputation: 515

Post » Wed Feb 03, 2016 3:59 pm

I just noticed when moving back to Floor2 from Laptop, the Laptop layout is still rendered but sits behind the Floor2 layout. Shouldn't the previous layout be destroyed once another layout is called? Can we destroy layouts using events?
B
8
S
1
Posts: 27
Reputation: 515

Post » Thu Feb 04, 2016 3:33 am

It because your global spr_HUD is on different levels. Keep the same number of levels across layouts and it fixes the problem. Otherwise C2 sees the object moved to layer 1, and when it goes back again, it's still on level 1. A side effect of Global objects I guess.
ImageImageImage
B
71
S
21
G
233
Posts: 3,696
Reputation: 130,368

Post » Thu Feb 04, 2016 6:37 am

Message: GuyManDude can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thank you very much for taking the time to help me blackhornet. I tried adding the additional layers and named them the same as they are on the other layouts but I still have a problem I don't know how to fix. The HUD layer now seems to remain in place, but objects from the Laptop layout remain on the screen after moving back to Floor2. I have replaced the capx with the current version. Would you be kind enough to fix it and make it available to me for download please?


http://1drv.ms/1P7oTAO
B
8
S
1
Posts: 27
Reputation: 515

Post » Thu Feb 04, 2016 2:49 pm

Message: GuyManDude can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Here is another experiment that is very close to being perfect. I left the HUD on it's own layer and moved all the Laptop sprites to their own layer. The only problem with this one is the spr_HUD sprite moves if you go back and forward between layouts.


http://1drv.ms/1PWzSCO
B
8
S
1
Posts: 27
Reputation: 515

Post » Thu Feb 04, 2016 3:12 pm

:? You've done it again. You have 8 layers on Laptop, but only 7 on the others. I personally don't use Global objects. They are more trouble than they are worth.
ImageImageImage
B
71
S
21
G
233
Posts: 3,696
Reputation: 130,368

Post » Thu Feb 04, 2016 10:26 pm

Sorry, I forgot to mention that I tried duplicating the 7 layers and still had problems. I'll do it again when I get home later and report back. I stumbled across the 8 layer solution after trying the 7. Still problems with both. Can you get the 7 layer version to work properly?
B
8
S
1
Posts: 27
Reputation: 515

Post » Thu Feb 04, 2016 10:43 pm

Yes. I'm not sure why you are using Global objects anyway. You are placing the spr_HUD object on each layout, so it's pointless making it Global. spr_lenovo_icon also gets confused. Making it non-global fixes that glitch too.
ImageImageImage
B
71
S
21
G
233
Posts: 3,696
Reputation: 130,368

Post » Thu Feb 04, 2016 11:53 pm

Thanks again for your help. Converting it non-global seems to have solved my problems! I guess I am confused at what global means. I thought by creating an object as global I could use it on numerous layouts instead of creating one object per layout?
B
8
S
1
Posts: 27
Reputation: 515


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION, Rayth and 14 guests