How do I create layer dynamically

Get help using Construct 2

Post » Sun Aug 03, 2014 11:29 am

Hello everybody,

I am making a point n click game and I don't know how to make my inventory menu.
This menu would pop up on top of any level (layout) and I would like to avoid creating this menu in the editor for every layout.

My idea was to create it dynamically in a specific top layer on start of every layout and then show/hide it when needed.
My problem is that it seems I can't create layers dynamically in construct 2. A workaround would be to put inventory element in the top layer of the layout but I can't even get the top layer's name (My layouts can have different numbers of layers for parallax).

Does anybody knows a solution/workaround for this ? Thanks
B
9
S
1
G
1
Posts: 7
Reputation: 1,689

Post » Sun Aug 03, 2014 2:35 pm

In the Create event put the Layer name in quotes: "HUD". This will work instead of a number.
ImageImageImage
B
71
S
22
G
248
Posts: 3,759
Reputation: 138,069

Post » Wed Aug 06, 2014 11:35 am

But i must create manually a layer named "HUD" in every layout... Not such a big deal afterall. thx
B
9
S
1
G
1
Posts: 7
Reputation: 1,689

Post » Wed Aug 06, 2014 11:35 am

But i must create manually a layer named "HUD" in every layout... Not such a big deal afterall. thx
B
9
S
1
G
1
Posts: 7
Reputation: 1,689

Post » Wed Aug 06, 2014 5:25 pm

Good luck man, i also want to know how to do this.
B
8
Posts: 20
Reputation: 302


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests