Jump to content

Search the Community

Showing results for tags 'window resize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Trying to think through how to dynamically resizing pixi stage on window resize. I'm using the following the set the size of my stage to the window, it works fine (though it distorts the images, does not keep ratio). stageWidth = $(window).innerWidth(); stageHeight = $(window).innerHeight();console.log(stageWidth, stageHeight); // create an new instance of a pixi stage var stage = new PIXI.Stage(0xff00ff); var renderer = PIXI.autoDetectRenderer(stageWidth, stageHeight);But how do I extend this to update the stage size when the browser window is resized? I tried the following (with a call to onResize inside my animate function) - it may be resizing the stage (i'm not sure), but it's not resizing the content - and I'm getting a warning in the console (WARNING: Too many active WebGL contexts. Oldest context will be lost): function onResize(){ $( window ).resize(function(){ stageWidth = $(window).innerWidth(); stageHeight = $(window).innerHeight(); renderer = PIXI.autoDetectRenderer(stageWidth, stageHeight); }) } Maybe I need to be updating the ' document.body.appendChild(renderer.view); ' instead? How would I do that, if in fact that's what I need to do?
×
×
  • Create New...