0 Favourites

Make a Global pause button

  • Hi, I?m 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 can?t get the game enabled again.

    How did you approach this?

  • How does the button actually work? Is it fading out, or animated?

    What does it do before it allows you to click on it?

  • Use system timescale 0 and then right after set pause button only timescale to 1.

  • 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 can?t 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. I?m 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?.

  • Construct 3

    Buy Construct 3

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

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

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
80 46,956
playtingz's avatar
playtingz
Unread hot topic
167 14,491
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,819
minhcuong's avatar
minhcuong