Jump to content

How to make game responsive to window resize


bubbut
 Share

Recommended Posts

Sorry if this has been asked many times. I looked through a few threads but couldn't get it working. I'm just trying to make my game resize as user resizes window or if the orientation is switched (on phone). I tried hooking into $(window).resize but it kept complaning that 'game' is undefined. I'm using TypeScript for my game. Any help would be greatly appreciated!

Link to comment
Share on other sites

Pedro, I looked at that sample and tried adding scale.hasResized.add(...) along with the function to the desktop mode but it doesn't work. It only fired the first time I run the game, but any subsequent window resize did nothing. I would like to have the game always be fully stretched to the entire browser window (up to some minimum/maximum size) whenever user resizes the window. Is that possible?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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