[Request] Global Layers (for HUDs, menus, etc.)

0 favourites
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • I think this one speaks for itself. Remember the 'inherited layers' feature from Classic? There are methods of replicating this sort of thing using global objects, but it requires setting up a whole bunch of layers in a certain order for ALL layouts, which can be a pain, and can be time-consuming for testing. I'd much prefer an in-built feature that lets you set up 'global layers' that are loaded on startup, are kept around when changing layouts, and ordering can be sorted on a layout-by-layout basis.

    It would certainly make everyone's lives a whole lot easier, I think.

  • While I'd like this kind of thing, you'd still need to specify in your game layouts which layers are to inherit the global layer.

    Personally, I don't find the use of global objects for UI elements to be too much of a hassle. The only issue is having to replicate layers in other layouts (or, rather, have the same amount of layers). If global objects were to appear on the same layer by name, rather than layer number, I think it'd make life far easier.

  • Well, yeah, inheritance would be kind of a given in order to enable ordering, but it's probably not really a problem.

    While having global objects appear on layers by name rather than number would be great, you still have to start another layout to initialize everything when you just want to test stuff, which is annoying. I'd like to at /least/ be able to immediately be able to test stuff and let the engine initialize stuff for me.

  • I think that is a great idea!

    In Layout properties you can choose your event sheet. And then on event sheets you can include other event sheets. It would be awesome to be able to include other layouts (either on top or below the current layout).

    That way if you want a HUD layout, you just include it (at top), but if you have help screens or a shop where you don't want it, you just don't include it on those layouts. That would be easy to implement!

  • I'm with you here. When a game has 60+ levels and I want to make a layer change... I have no option other than doing it all manually.

  • AllanR

    Love the idea. My Current game has 100 levels and layer changes can be a bit of a chore to say the least.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You guys are discussing 2 different things. "Global/Inherited Layers" is not the same as having every layout use the same layers.

    Since you can already make objects global, all we really need is an option to make all layouts share the same layers & their properties. This way you can build HUDs & GUIs in one layout AND modify all game layers in a single layout.

    Kill 2 birds with 1 stone as they say.

  • Isn't that basically what I said?

    "all we really need is an option to make all layouts share the same layers" is what I meant by having an "Include Layout" in the Layout Properties section, with an option to set the included layout on top or underneath the current layout.

    I do realize that is not quite what the OP was asking for, but I thought "Include Layout" would be easier to implement (and less confusing for people).

  • It is similar to those 'master pages' you find in rapid website development. You can create a sort of template - including topmenu, header, etc. - and 'apply' it to the pages you want (not necessarily to all the website). Since C2 is strictly related to website creation now with html5, the Browser object ecc., it could be a great improvement.

    I don't know if this can help. My solution would be to create gameplay layouts with an 'empty' upper layer (so you don't have to modify it later once per game level), then you create an event sheet (you call it 'UI sheet' for instance) where you create the GUI objects by actions and place them on the empty layer. You can include this event sheet in all the levels sheets, so you just develop once. Not sure about what may happen? Create an unaccessible layout where you play with the user interface objects on the screen so you can get an idea of what you will see (you can track down the object 'desired' positions and then create the GUI objects and place them at the same positions with sheet actions).

    Sounds like a workaround, but at least you don't have to make the same change on a hundred levels <img src="smileys/smiley1.gif" border="0" align="middle" />

  • +1! Being unable to easily recreate layers across multiple layouts causes me to fear making levels and work on just 1 layout until I think I won't need more layers :P

  • I thought I replied in this thread before :P

    Yes. I agree +9000 for a form of Master/Inheritable layout.

    While I tend to use prorammatic cross level HUDS now. A visual style would be more appealing.

    I've used the design of Global objects for HUDS. which does work. but then require more management to destroy/hide/rebuild when going to layouts and screens that don't need them.

  • Nice to know my modest proposal has support. We'll wait and see whether Ashley will implement it.

  • +1 from me too.

  • While I tend to use programmatic cross level HUDS now. A visual style would be more appealing.

    I'm using a generated HUD and although it's a piece of cake to add the Hud Event Sheet as an include to any layout, a problem manifests when you want to apply the HUD to a unique layer in or on top of a Layer Sandwich. The problem is that for everything to work dandy you must have defined the layer on the layout on which you want the HUD to appear and unless I've missed a trick you can't create a new layer on the fly. Therefore you have to at a minimum visit every Layout in your game and create the "hud" Layer which as has been alluded to from the OP onwards can be very long winded.

  • bertie Booster Or just plan from the start and add a HUD layer each time you create a new layout. I am now going with Creating a template layout with all needed layers and then duplicating it to make my other layouts.

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