[SUGGESTION] Inject Layout like Event Sheet

Discussion and feedback on Construct 2

Post » Fri Oct 11, 2013 5:14 am

Maybe this is minor issue, or there is other solution,
but let's say that you have 100 layouts, and at the end you noticed
that you have to move object X from X1, Y1 to X2, Y2 on all layouts

now you have to do all by hand
but it would be nice to have possibility to inject objects (for example with HUD) from one layout to other layouts
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Fri Oct 11, 2013 5:34 am

Generally for anything that is across all layouts, like a HUD, you event their positions in instead of manually placing them.

For example: at start of layout: create healthbar on layer "hud", viewportleft("hud"), viewporttop("hud")+25. Then just make sure that is in an event sheet common to all layouts and you're golden.

One thing that can get really bad though is needing to alter a layer's name!
B
28
S
8
G
5
Posts: 429
Reputation: 6,997

Post » Fri Oct 11, 2013 7:09 am

@Tobye

thanks!!! :)
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Fri Oct 11, 2013 11:59 am

@Tobye

One way to access layers is to setup a list of constant variables that match the index numbers of the layer...

LYR_MAINMENU = 4
LYR_HUD = 3
LYR_FOREGROUND = 2
LYR_PLAYER = 1
LYR_BACKDROP = 0

System -> Set Layer LYR_MAINMENU Visible

If I delete/add/rename/shift layers I only have to update the constant var list to match and everything still works etc...

Hope that helps
B
8
S
3
G
1
Posts: 34
Reputation: 1,395

Post » Fri Oct 11, 2013 6:27 pm

@arontwose - Yeah that's a good idea! Thanks. Also though, adding layers to all layouts can be a pain, so I usually always have at least 2 spare layers. It'd be nice to have an 'add layer to all layouts' option.
B
28
S
8
G
5
Posts: 429
Reputation: 6,997

Post » Fri Oct 11, 2013 11:11 pm

[QUOTE=szymek]
but it would be nice to have possibility to inject objects (for example with HUD) from one layout to other layouts [/QUOTE]
This can be accomplished with global objects. Makes it very convienent and easy to work with. Specifically if you're looking to create a consistant "HUD" or "GUI" A great tutorial by GeometriX exists. You can Find it here.
Building a global user interface (UI)
B
87
S
14
G
9
Posts: 101
Reputation: 9,937


Return to Construct 2 General

Who is online

Users browsing this forum: Cliffu, jakezinis and 4 guests