Make a Global pause button

Get help using Construct 2

Post » Thu Nov 01, 2012 2:50 pm

Hi, Im trying to make a global button of pause for my game.
But is not working as I thought it would be.
Do you use Time scale function for this?. I tried using it and it works but it affects the button too, so it takes a while until it starts again From the pause state.
I used:

--Set time scale to 0.01
--and set time scale to 1.

If I set on pause time scale to 0, the button gets affected too and I cant get the game enabled again.
How did you approach this?
B
11
S
1
G
2
Posts: 57
Reputation: 1,690

Post » Thu Nov 01, 2012 4:46 pm

How does the button actually work? Is it fading out, or animated?
What does it do before it allows you to click on it?keepee2012-11-01 16:46:43
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Nov 01, 2012 6:06 pm

Use system timescale 0 and then right after set pause button only timescale to 1.
B
14
S
5
G
4
Posts: 121
Reputation: 3,938

Post » Fri Nov 02, 2012 2:44 am

Great!
Yeah, I just did that.

I used
"SET TIME SCALE TO 0"
and in the same event
"SET OBJECT (BUTTON PAUSE) TIME SCALE TO 1"
To prevent the pause button to get paused also.

I also used a boolean toggle value to get the menu on and off and it worked really well.

What I cant get to work now is the Exit button from that pause menu. In browser it works perfect. But apparently the "browser" object is not fully supported by CocoonJs. Im using "BROWSER" -- "CLOSE" Action to exit the application. But is not doing anything on the mobile.

Does anyone know another way around to do this?.


B
11
S
1
G
2
Posts: 57
Reputation: 1,690

Post » Fri Nov 02, 2012 3:09 am

[QUOTE=3division]I used
"SET TIME SCALE TO 0"
and in the same event
"SET OBJECT (BUTTON PAUSE) TIME SCALE TO 1"
To prevent the pause button to get paused also.

I also used a boolean toggle value to get the menu on and off and it worked really well.
[/QUOTE]

This is good info to remember. I forgot among all the reading I have done that you can set timescale on a per object basis.
B
18
S
6
G
2
Posts: 22
Reputation: 2,339


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jul and 20 guests