How do I Put a Layout Inside Another Layout

Get help using Construct 2

Post » Sun Mar 22, 2015 11:20 pm

I don't know if this is possible, but I'm wondering if someone has achieved drawing one layout inside another. The reason I want to do this is so that I can design a pause/inventory menu for my game that I can just link back to without creating a new layer in every layout or switching layouts

It wouldn't be a terrible alternative to have to switch layouts for this, but it'd be a lot easier just to be able to replace a layer in each game map layout with the pause menu layout.

If anyone can help with this, that'd be awesome! Thank you!
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Mon Mar 23, 2015 12:13 am

You can't run layouts within layouts, but check out global layers for HUDs etc.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,244
Reputation: 46,462

Post » Mon Mar 23, 2015 1:17 am

Thanks a lot! I'll look into that!
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Mon Mar 23, 2015 1:23 am

Not really what I was looking for, but maybe the only option? I think there should be a way to include layouts within layouts though..
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Mon Mar 23, 2015 1:45 am

It's impossible for layouts to be within layouts, or for them to be inter-connected in anyway, e.g. multi-layout editor, in Construct 2.

If you look back enough there's several threads I and other people made asking for Multi-layout editors and such but Ashley said it's impossible with the current architecture of the engine.

it's possible in Construct 3 since we'll be getting an editor SDK, but even then it's up to some genius to make it possible and not Ashley.

Your best bet is to make a save state of the game when switching to the pause menu and just loading the state when you exit the menu.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Sat Mar 28, 2015 11:49 pm

Nesteris wrote:It's impossible for layouts to be within layouts, or for them to be inter-connected in anyway, e.g. multi-layout editor, in Construct 2.

If you look back enough there's several threads I and other people made asking for Multi-layout editors and such but Ashley said it's impossible with the current architecture of the engine.

it's possible in Construct 3 since we'll be getting an editor SDK, but even then it's up to some genius to make it possible and not Ashley.

Your best bet is to make a save state of the game when switching to the pause menu and just loading the state when you exit the menu.


Rather than using save states I'll use an array to store the progress of the game, because save states won't do what I need it to.

So two layers can't run side by side... It seems like it'd be an easy task. Set up a layer that connects to a layout in the GUI and make the script that'd run the other layout run at the same time the layout you're actually on runs. The GUI would tell the engine to include the objects from one layout in the other, so you could include the event sheet that the other layout uses within the event sheet of the one you're actually on.

I'd have to take a look at Construct 3 later to see how that'd work though.

I also had the idea of just throwing all the objects I need for the menu in a folder and when I create a layout that uses the menu, create an event sheet that controls the object's positioning and then make them invisible when the menu isn't open, but that might become pointless.

I'll just go with your suggestion...
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Sun Jul 09, 2017 4:27 am

For an inventory, I make another background over my layout and change it to visible when button is pressed. Then I put everything I need on the background switching between invisible/visible. This may not be the most efficient way, but it works for me. Though I haven't yet figured out how to pause my game.
B
9
S
1
Posts: 4
Reputation: 456

Post » Sun Jul 09, 2017 8:50 am

I don't think is possible. If you don't want a layer, you could create your inventory panel + all elements in a container when you need them and destroy after that. Use a container/family maybe , or create and position each individually
B
82
S
21
G
23
Posts: 517
Reputation: 18,731

Post » Thu Aug 03, 2017 6:53 am

Meh, this was a rookie question. I use one layout for every level in my game. I think I asked this question because I wanted split-screen players to be in different levels at once, allowing them to team up or play independently at will.

To achieve this, I created a system that loads two levels into the layout, splitting the layout halfway, so one half is for one player and the other half is for the other player. The levels load into those areas. It works well, besides, I'm also making a full editor so that iterating on the game will take an incredibly short amount of time, at least from a development standpoint.

I didn't want to do this originally, because two years ago I wasn't actually able to. So, I guess it all comes down to: If you want a feature that isn't really natively possible (at least not easily) in Construct 2, build your own engine inside of Construct 2. The editor I'm making has a cutscene/dialogue editor with branching paths, as well as a tilemap/terrain sculpting/plotting interface, and visual scripting. I'm using Construct 2 to "build the bones", so to speak, but when it's complete, it will likely feel more like an independent engine.

Also, if you're wondering about performance, it's not an issue. I've created a lot of different methods to optimize processing and memory use that I will likely make tutorials over when my game is complete. As well as tuts for everything else.
ImageImage
B
49
S
15
G
2
Posts: 270
Reputation: 6,649

Post » Sat Aug 05, 2017 5:29 pm

That sounds great ! Could we have a capx ?
B
6
S
1
Posts: 29
Reputation: 408

Next

Return to How do I....?

Who is online

Users browsing this forum: Pillarist and 56 guests