Changing Layout Issue?

0 favourites
  • 11 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Ok,

    I have read almost every single forum post about changing layouts, but for some stupid reason I cant seem to get a simple pause screen to work.

    I have done the set layer visible and that works but this is very messy when my pause screen has 6 layers for different effects going on.

    I made a Pause screen layout and a 1st game level layout, now I have got a graphics I click and it will take me back to game level 1, but when I try to click the pause graphic in the game level 1, it goes nowhere??

    Any reason for this? So in simple terms, Pause menu to game works, but game to pause menu does nothing, it just doesn't want to change layouts. And like I said, with the one layout but setting thing visible and invisible is a huge task when you have heaps of layers and are making a platform game with 20 levels. So I really want to be able to change layouts for , Menu, Pause screen, New Levels etc.

    Any help would be great, as this is driving me slowly crazy, lol.

  • are you sure your eventsheets are coupled correct, like if you made the events for the pausescreen in a pausescreen eventsheet, you also need an event in the level1 eventsheet to return to the pausescreen

    well a better way would be using includes, so a pausescreen include with the events and then include on every level and pausescreen

  • Couls you show an example? I think what you said about needing a event in lvl:1 to return to pause.

    I have a simple, when left click on object, go to layout Pausescreen, and that's in the lvl:1 sheet. Then in the pause screen Ive got the same but the other way around, and that's in the pausescreen sheet. Do they need to both share these codes?

    Cause like I said, if I start the game in pause screen I can click and goto game, but when in game I cant goto pause screen, if this makes sense?

  • hmm, it should work, maybe your evensheets are not linked to the layouts

    click on a layout in project (rightside), on the leftside properties you see wich eventsheet is connected to this layout ...

    anyway i will post an example how i would make it

  • Ok here is my sheet, now two things I cant get to work.

    Sound: Sounds starts fine when I goto puse screen, but when I goto game layer ( layer 0 ) it keeps playing, it wont stop. How do I stop it.

    2nd: The button. How do I make it so when object clicked BUT on release it changes screen and plays a sound.

    I want it so when you touch the button the button sucks in then when you take your finger off its plays a sound and then changes layer.

    I know the size change of the button part just the action of , when clicking on ( object ) and is released, play sound and change to layer ( 0 )???

  • Object release, I just cant seem to work my head around it?

    There is a when object click, but no when object is released.

    Anyways, I sent you the sheet pic bud.

  • example

    main eventsheet connected to all layouts and pauzescreen,

    in main evensheet you include the pauze eventsheet

    to work with multiple layouts we will need a global var "currentlayout"

    i made an event: onstart layout + layoutname isnot pauzescreen set currentlayout to layoutname, this will set the global var to current layoutname only when in a level

    now you create 2 buttons, one in pauzescreen that on click will go to layout(name) > ( our global var currentlayout) , and one button that will always go to pauzescreen in the levels

  • object release = mouse is over object + on left button released

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cheers bud, ill get onto this now. Will this also stop the music from playing?

  • Your system is working great, only thing is I cant stop the music when changing layouts?

  • Don't stress, working now. Must have been the update. Thanks for your help bud.

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