Multiple Layouts

For questions about using Classic.

Post » Sat Jul 14, 2012 9:20 pm

I have a very basic inventory that basically just looks to see whether an object is overlapping an inventory, on it's own layer. Is there a way to have my inventory carry over to the next layout?
B
4
Posts: 18
Reputation: 336

Post » Sun Jul 15, 2012 1:05 am

Yes, there is. It is the property "Inheritance layer"
Name the layer that shows your inventory and in another layout just create a layer and enter that name in the text field of the property.

Layout 1
Layer named "MyInventory"

Layout 2
Layer named "Whatever"
Inheritance Layer Property of Layer "Whatever" set to "MyInventory"

There are issues with positioning, so this works best if both layouts have the same dimension, or if the layer you want to inherit is set to not zoom or scroll (both 0%)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Jul 26, 2012 10:57 pm

Sorry it took me a while to try this out because I thought I had decided on a different way of doing things. Now I want to have multiple layouts again but I cannot get this to work. The objects will not carry over to the next layout. The layer pops up in its original form but not with any of the sprites that have been added to the layer.
B
4
Posts: 18
Reputation: 336

Post » Thu Jul 26, 2012 11:45 pm

[QUOTE=fiddilydee]The layer pops up in its original form but not with any of the sprites that have been added to the layer.[/QUOTE] Then you've done something wrong. Here is a basic example: inheritance.cap
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Jul 27, 2012 1:37 am

No that works fine but it doesnt help if you add another sprite to the layer. If it spawns a sprite for example or you drag and drop it on there, it won't stay when you switch to the next layout. I can get it to do what you did, in the second layout it's as if the layer rebooted.
B
4
Posts: 18
Reputation: 336

Post » Fri Jul 27, 2012 4:12 am

Just make the objects of the inventory layer, that you create at runtime, 'global' (under properties->common)

Objects (and instances) that are local and are created during runtime will get destroyed as soon as you switch to another layout. To keep them alive, they need to be global in scope.

Here's the extended example cap: inheritance2.captulamide2012-07-27 04:13:07
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Jul 27, 2012 1:24 pm

I gotta say Mr. Tulamide you have been a real help to me getting this project going. I think you have solved or at least explained every problem I have had so far. I really appreciate it, If I ever finish this game I will give you a credit as programming consultant, lol. Unless it ends up horrible and you don't want your name on it, which may be the case, but again thank you very much. Oh and yeah that worked.
B
4
Posts: 18
Reputation: 336

Post » Fri Jul 27, 2012 8:36 pm

Thank you
I'm glad I could be of help. And imagine my big grin. "Progamming consultant"? Sounds good!

I hope you'll finish it. Can't wait to see that credit entry...
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest