Xellpher Posted April 13, 2016 Share Posted April 13, 2016 Hi, I've read quite a few posts on the forum but didn't really find an answer, so if it has been answered elsewhere I'd be happy to get a link. I'm currently trying to make a game using Intel XDK and Phaser (I'm new to both, though). The game will be pretty simple and mostly static, basically a board game on a mobile screen. I'm using the CANVAS renderer, and I'm drawing directly to the canvas (no sprites, no images, just drawing primitives). There are no issues with different screen sizes or aspect ratios, as the game scene is calculated to fit into any ratio and size. Phaser will basically only be used to handle the setup, level loading and stuff (yeah I guess I could ditch Phaser and make a pure canvas game, but Phaser seemed to make it easier to get into mobile development). I noticed that the canvas size is only half of the device size, which seems to result in blurry lines and jagged edges on my device (Nexus 5) and even in the emulator of XDK. Due to the game being static, I don't expect any performance issues with full HD resolution. So my questions are: Is there a way to set the full device resolution to the canvas? Is there a way to control render updates etc? I don't need 60 render cycles per seconds on a static scene with nothing moving, I'd prefer updating the scene on demand (after something actually changed). Thanks! Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted April 13, 2016 Share Posted April 13, 2016 For mobile devices use code: canvas_width = window.screen.availWidth * window.devicePixelRatio; canvas_height = window.screen.availHeight * window.devicePixelRatio; game = new Phaser.Game(canvas_width, canvas_height, Phaser.CANVAS, 'gamewindow'); And use plugin SaveCPU Xellpher 1 Link to comment Share on other sites More sharing options...
Xellpher Posted April 14, 2016 Author Share Posted April 14, 2016 @VitaZheltyakov Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts