Changing Layout Issue?

Get help using Construct 2

Post » Sun Jun 17, 2012 4:46 am

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.
B
6
Posts: 23
Reputation: 496

Post » Sun Jun 17, 2012 4:55 am

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
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 17, 2012 5:31 am

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?
B
6
Posts: 23
Reputation: 496

Post » Sun Jun 17, 2012 5:59 am

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
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 17, 2012 6:06 am

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 )???
B
6
Posts: 23
Reputation: 496

Post » Sun Jun 17, 2012 6:11 am

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.
B
6
Posts: 23
Reputation: 496

Post » Sun Jun 17, 2012 6:18 am

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 levelsvtrix2012-06-17 06:20:21
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 17, 2012 6:26 am

object release = mouse is over object + on left button released
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 17, 2012 6:28 am

Cheers bud, ill get onto this now. Will this also stop the music from playing?
B
6
Posts: 23
Reputation: 496

Post » Sun Jun 17, 2012 7:59 am

Your system is working great, only thing is I cant stop the music when changing layouts?
B
6
Posts: 23
Reputation: 496

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests