achexi Posted December 15, 2014 Share Posted December 15, 2014 In the older versions of pixi I used to be able to create a canvas in my html document and do something like this:view = document.getElementById('game-canvas');renderer = PIXI.autoDetectRenderer(this.GAME_WIDTH, this.GAME_HEIGHT, view);However in the newer versions of pixi the canvas simply does not appear on screen. I don't get errors or anything, the only way I can get a canvas is if I let pixi make one for me via something like:renderer = PIXI.autoDetectRenderer(this.GAME_WIDTH, this.GAME_HEIGHT);document.body.appendChild(renderer.view);What's changed and what must I do to force PIXI to use a canvas I make on the screen? Quote Link to comment Share on other sites More sharing options...
alex_h Posted December 15, 2014 Share Posted December 15, 2014 You pass the canvas through as a property of an options object, see the info on the pixi github page: *** IMPORTANT - V2 API CHANGES ***A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small.1: Creating a renderer now accepts an options parameter that you can add specific settings to:// an optional object that contains the settings for the renderervar options = {view:myCanvas,resolution:1}; Quote Link to comment Share on other sites More sharing options...
achexi Posted December 15, 2014 Author Share Posted December 15, 2014 thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.