Multiple Layouts

This forum is currently in read-only mode.
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • 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?

  • 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%)

  • 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.

  • The layer pops up in its original form but not with any of the sprites that have been added to the layer.Then you've done something wrong. Here is a basic example: inheritance.cap

  • 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.

  • 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.cap

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you <img src="smileys/smiley1.gif" border="0" align="middle" />

    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... <img src="smileys/smiley4.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)