How do I use shared layouts?

0 favourites
  • 6 posts
  • Hello all,

    I have 3 game modes, which uses all of the "classic" game mode objects, in addition to their own mode changes.

    Is there a way to "Extend" the layout, or to share it, other than cloning it for each game mode? this will force me to add objects to all layouts if I'm developing the game further.

    I know I can have global objects, but this will require me to go through each object and use "Create Object" on them before I can use them, since they are there for reference only (global object don't appear in each layout as well, but they can be referenced from every other layout).

    Thanks!

  • Can you give me a short example in a form of explanation of what you are trying to achieve?

    If you are talking about objects being global from 1 layer from a layout to another layer with the same name from another layout, then you can use global layers .

    Reference:

    https://www.scirra.com/tutorials/594/bu ... terface-ui

    https://www.scirra.com/manual/85/layers

    inherited-layer-cross-multiple-layouts_t76247

  • By Game mode you mean layouts? If so, yes. You need to clone them. Althought It all depends of what you are trying to do. If game mode changes means just changing some values, creating objects and other dynamic stuffs then you can do it in the same layout and use variables to determine in which level the player is. If means to change the entire world of that layout then starting a new layout is needed.

    Bear in mind that construct works this way. If you want to use any object you have to have at least one instance example in the layout start. Most of the people delete objects on start of the layout and the rest is done by routines on the events.

    Edit: Also I think you are miss understanding the use of objects. Unless you are doing a super simple game where you only use instances that you already have on the start of layout, you will always handle objects creation/destroy by events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you give me a short example in a form of explanation of what you are trying to achieve?

    If you are talking about objects being global from 1 layer from a layout to another layer with the same name from another layout, then you can use global layers .

    Reference:

    https://www.scirra.com/tutorials/594/bu ... terface-ui

    https://www.scirra.com/manual/85/layers

    inherited-layer-cross-multiple-layouts_t76247

    Thanks ! Global Layers ROCK! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> Now I only add new layers per game mode, and reuse the rest <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • , like I wrote in the first post, They have most of the UI in common, although in each game mode some additional UI elements are present. Didn't see the need to clone layout, and every time I add a "shared" ui object, add them in all layouts.

    Global Layouts were the answer to that, since now I can define shared layouts, and put the per-game-mode UI objects in their own respective layouts.

    Up until now, I did use create/destroy methods in my game screen, and I'm well aware about the one instance thingy

  • , like I wrote in the first post, They have most of the UI in common, although in each game mode some additional UI elements are present. Didn't see the need to clone layout, and every time I add a "shared" ui object, add them in all layouts.

    Global Layouts were the answer to that, since now I can define shared layouts, and put the per-game-mode UI objects in their own respective layouts.

    Up until now, I did use create/destroy methods in my game screen, and I'm well aware about the one instance thingy

    Well, you didn't mention UI elements. In this case I'd have suggested you global layers but not for actual game if you know what I mean.

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