Pause Menu and Window Postion HELP!!

Get help using Construct 2

Post » Sun Aug 26, 2012 12:27 pm

Hi there, I have been struggling to get this work for a hour now

How do I get the center co-ordinates of the window at all times ?
I want to bring up the pause menu like the resume button and the main menu button while the timescale of the game is 0.
I want to get them both at the center of the screen one below the other.

I tired windowheight/2 and windowwidth/2 for the said buttons but that
doesn't work because that will give it a definite position.

I want to get these buttons created in the center of the window on esc down, irrespective of the player position on the layout.

I also have a doubt about. When a new layout is loaded is the other layout still running in the background.

And is there anyway if i could just keep everything the same when esc button down go to a new "pause" layout and then when clicked on resume in the "pause" layout the game beigns from where it stopped??
B
7
S
2
G
3
Posts: 23
Reputation: 2,403

Post » Sun Aug 26, 2012 1:44 pm

To get the center position of the viewport use 'ScrollX' and 'ScrollY'.

Edit: Use parallax as mentioned below if it suits your needsNimtrix2012-08-26 14:02:51
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Aug 26, 2012 1:59 pm

For me~
I will set a layer to parallax 0,0 for interface~
If I need to create a fantastic menu~
I will set more layers into parallax 0,0~

I think no, a new layout is like a new page~
Everything refreshed except global variable~AkiraWong2012-08-26 13:59:57
B
13
S
5
G
3
Posts: 63
Reputation: 3,989

Post » Sun Aug 26, 2012 1:59 pm

To bring up a pause menu, make a new layer and set the parallax to 0,0. Parallax determines how fast or slow the layer scrolls relative to the others; 100,100 is normal, 150,150 is 1.5 times faster, 50,50 is half as slow, and 0,0 means it won't move at all. Which means no matter where you are in the level, the pause menu will ALWAYS be in the center of the screen.

As for loading new layouts and then trying to go back to the previous one... yeahhh, don't even try. You'd have to manually save the state of the layout before leaving it and then manually reset it once you go back. Pause menus can be inside the regular layout, just invisible; when the player pauses, make the menu visible. No need to switch layouts.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sun Aug 26, 2012 3:14 pm

Thank you AkiraWong,SullyTheStrange,Nimtrix !!

It worked :)
B
7
S
2
G
3
Posts: 23
Reputation: 2,403

Post » Sun Aug 26, 2012 5:51 pm

I am using the pin behavior and then it follows my center object eg. player
B
9
S
2
Posts: 100
Reputation: 1,335


Return to How do I....?

Who is online

Users browsing this forum: djcrazypants, marekmk and 6 guests