[SOLVED] How do I use layout.name function?

Get help using Construct 2

Post » Sun May 25, 2014 5:21 am

Hey guys!
I want to make a button which will work in one Events sheet.
By pressing this button i need to switch layout
If the current Layout is = (Layout 1) then go to Layout 2 and so.
How can i get the layout name as an sub event or event.
Thanks!
Last edited by makarone on Fri May 30, 2014 8:51 am, edited 1 time in total.
Image
B
12
S
4
Posts: 13
Reputation: 828

Post » Sun May 25, 2014 5:29 am

Use the System "Go to layout (by name)" action.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Sun May 25, 2014 9:05 am

makarone wrote:Hey guys!
I want to make a button which will work in one Events sheet.
By pressing this button i need to switch layout
If the current Layout is = (Layout 1) then go to Layout 2 and so.
How can i get the layout name as an sub event or event.
Thanks!


Just enter "LayoutName" (without quotes), it will return the current layout name
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Fri May 30, 2014 8:04 am

Thanks for the answers, but this is not what i need.

For example, i have 3 layouts (A,B,C)
I have a button BTN

Each layout has this button
And all 3 layouts controls by !one same Events sheet

I need to write in this sheet- If i press the button BTN and if the current Layout name is Layout A i need to switch the game to the layout B. On the Layout B i need this button move me to the layout C and if i will put this button at the Layout C i need to go to Layout A.

How to use these control in the single Events sheet?


Thanks
Image
B
12
S
4
Posts: 13
Reputation: 828

Post » Fri May 30, 2014 8:51 am

SOLVED.

Create blank sub event under your main evet ( for example "button was clicked")
Select System- Compare values
Compare:

LayoutName
= Equal to
"enter layout's name" - with quotes

And then add action to switch to the required layout.

Works!
:)
Image
B
12
S
4
Posts: 13
Reputation: 828


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 4 guests