Jump to content

Pause screen in world viewport with higher bounds than viewport


Julia
 Share

Recommended Posts

Hey,

 

I'm figuring out how to set a pause screen on my vertical platformer game. Everything is working fine, except I don't know how to position the pause screen in the current viewport and not at the complete top of the game. The game itself is 5000px high and the viewport is 600px. I've tried different things, but so far without success.

 

My pause function, which is now positioned at 0, 0

 

managePause: function () {game.paused = true;var graphics = game.add.graphics(0, 0);graphics.beginFill(000000, 0.5);graphics.drawRect(0, 0, 1200, 600);var vowText = this.add.text(600, 300, vow1, fontStyle);vowText.anchor.setTo(0.5, 0.5);this.input.onDown.add(function() {vowText.destroy();graphics.destroy();game.paused = false;}, this);},

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...