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

  • 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!

  • Use the System "Go to layout (by name)" action.

  • 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

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

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