Announcement

Collapse
No announcement yet.

Pause/Resume Buttons

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pause/Resume Buttons

    When I open my packaged HTML5 game in a browser, it begins "Paused" and to play I have to click "Resume." Is there either a way to make the game not paused on startup, or is there a way to indicate in-game that the game is paused?

    I tried making a simple menu for when it is paused, which works when I use an input (such as "P") to "Set Game Paused" but clicking the buttons at the bottom of the game seems to be considered a different type of pause, so my pause menu does not show up.

    Also, is there a way to remove the "Fullscreen" "Pause" "Resume" and "ClearStoredData" buttons from the bottom of the game? Thanks for any help!

    #2
    Hey Namcap,

    Do you have a public link to your game which can be viewed? Do you have UMG or any blueprints set up that will cause your game to pause on start up? If so, I would suggest uploading screenshots so we can see how you've configured your project.

    - Samantha
    Twitter @UnrealSamantha
    Mobile Development Troubleshooting Guide | Package and Deployment Troubleshooting | How do I report a bug?
    Call me to a thread by posting this: [MENTION]Samantha Sutton[/MENTION]

    Comment


      #3
      I've posted my game to a website here: http://www.kongregate.com/games/nam_cap/summate

      (If that link isn't allowed here, I can remove it and private message it to you)

      Please give it a moment to load. The issue is that I can click on the UMG buttons, but I cannot use the keyboard to move my character until I click "Resume." Then a similar problem occurs when you click somewhere else on the page, then click back on the game -- the only way to move the character is to click "Resume."

      I haven't implemented anything in UMG or elsewhere that would cause my game to pause. I've tried forcing the game to focus on viewport whenever the game is clicked on, but that doesn't seem to solve this issue.

      Is there a way around this? And is there a way to remove those buttons from the bottom of my game? (Since I don't really have any use for them)

      Also, slightly off-topic from the title -- but do you know why the loading process is so slow for such a basic game? There isn't much to it, but the initial loading takes a fairly long amount of time.

      Thanks!
      Last edited by namcap; 07-06-2015, 10:33 PM.

      Comment


        #4
        Hey Namcap,

        Thanks for providing me with the link. I have launched it on Google Chrome and I have been able to successfully play the game without any trouble. I did not notice a long loading time however, if there is a long loading time it's typically due to your computer memory, your browser used and of course, your internet speed. If you have slow downloading bandwidth, it will take longer to load. When the game first loads up, it says "PLAY" which I then click on and the game begins. There is not a pause screen between each level in the game. I've also been able to move my box around. You must make sure that 'resume' is selected for your game to recognize that you're able to move the box around. I've gotten all the way to the 'number 16' level where it doesn't move to another level.

        I've looked over our HTML5 example game 'Tappy Chicken' and I do not see those buttons listed. Therefore, there is a way to take them out. Since the game is HTML5 basically, you simply would need to open up the .html file and modify it the way that you'd like it to be.

        " <div class="emscripten">
        <input type="button" value="Fullscreen" id="fullscreen_request">
        <input type="button" value="Pause" onclick="Module['pauseMainLoop']();">
        <input type="button" value="Resume" onclick="Module['resumeMainLoop']();">
        <!--input type="button" value="Quit" onclick="__exit(0)" -->
        <input type="button" value="ClearStoredGame" onclick="$.jStorage.flush()">
        </div>"

        This is the section within the .html5 coding that you'd want to get rid of, or simply modify. You may want to read a bit further down into the code to make sure it's all removed and exactly how you'd like it.

        Thanks!
        Twitter @UnrealSamantha
        Mobile Development Troubleshooting Guide | Package and Deployment Troubleshooting | How do I report a bug?
        Call me to a thread by posting this: [MENTION]Samantha Sutton[/MENTION]

        Comment


          #5
          Thanks for playing so far into my game and finding the necessary code for me to change!

          I was able to remove the buttons, but I'm still not entirely sure how to make the game auto-resume when the game window is being focused on.

          I tried using: window.onfocus = Module['resumeMainLoop'];

          Just after:

          "<div class="emscripten">
          <input type="button" value="Fullscreen" id="fullscreen_request">
          <input type="button" value="Pause" onclick="Module['pauseMainLoop']();">
          <input type="button" value="Resume" onclick="Module['resumeMainLoop']();">
          <!--input type="button" value="Quit" onclick="__exit(0)" -->
          <input type="button" value="ClearStoredGame" onclick="$.jStorage.flush()">
          </div>

          <textarea class="emscripten" id="output" rows="8"></textarea>

          <script type="text/javascript">"

          but that does not seem to work. Would you know how to solve this issue?

          Thanks for the help, I greatly appreciate it!
          Last edited by namcap; 07-07-2015, 11:47 PM.

          Comment


            #6
            Hey Namcap,

            " he issue is that I can click on the UMG buttons, but I cannot use the keyboard to move my character until I click "Resume." Then a similar problem occurs when you click somewhere else on the page, then click back on the game -- the only way to move the character is to click "Resume."


            Does this happen when you don't use the kongrete website, eg - when you the run the game locally?

            -Ankit

            Comment


              #7
              Hi Ankit,

              This does not happen when I run the game locally. I never have to click "Resume" to get the game to work properly.

              I was surprised when I uploaded the game to Kongregate and had this issue -- I'm not sure what the difference is between local and web.

              Comment

              Working...
              X