Call layer from a different layout?

0 favourites
  • 4 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I am going to create an in-game menu in the form of a separate layer so on start of layout, set layer invisible then on pressing the 'pause' button, set layer visible etc etc

    However, instead of having to recreate the same layer and all the objects that go with it, over and over again for all of my levels, is it possible to give the one layer a name and call it to the front of the current layout?

    Or if I am going about this in completely the wrong way, can anyone give me any suggestions please?

  • As far as I know that's not possible I'm afraid (And if it is then I really wish I knew that!). Your best bet is probably just to create a new Layer on each Layout, but then dynamically create the actual menu on that layer when they press Pause, if you don't want to copy and paste it to each Layout.

    So, create 'MenuBackground' on PauseLayer at whichever position, and then create all the options on top. You'd only have to do that once as you can just use those events across all Layouts.

    Someone who knows more might have a better solution though!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah ye, that's one way round the problem. I'll give that a go, thanks.

    However, it would be reaaaaally useful to be able to "call 'layername' to current layout" wouldn't it!?! :D

  • Construct Classic had an option for that, called Inheritance Layer. It'd be nice to see that make a return.

    For now, a method R0J0hound suggested to me that I've taken to using is to have my HUD and menus and such being set as global objects (that way they persist from layout to layout, useful for complicated HUDs) and then having them created at startup, while having a separate event sheet handle all the necessary events for HUD/menu management that I can just include in other layouts. Works rather nicely.

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