jcwhall Posted March 22, 2014 Share Posted March 22, 2014 Is it possible to run PandaJS in a a div which has a fixed width and height? i.e. instead of PandaJS taking up the whole window, can I set it to run in a div which is say 640px x 480x? Thanks a lot. Keep up the great work with the engine Quote Link to comment Share on other sites More sharing options...
enpu Posted March 22, 2014 Share Posted March 22, 2014 Sure. http://www.pandajs.net/docs/classes/game.Core.html#method_start As you can see, you can define width and height in start method. Example:game.start(SceneGame, 640, 480);Or you can create your canvas element before starting the engine:<div><canvas id="myCanvas"></canvas></div>game.start(SceneGame, 640, 480, null, 'myCanvas'); Quote Link to comment Share on other sites More sharing options...
jcwhall Posted March 22, 2014 Author Share Posted March 22, 2014 Great thanks a lot! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 22, 2014 Share Posted March 22, 2014 No problem! Thanks for using Panda Quote Link to comment Share on other sites More sharing options...
jcwhall Posted March 22, 2014 Author Share Posted March 22, 2014 another quick question; Is there a way to stop the rest of the page content disappearing / page turning to black when panda has loaded? This only happens on mobile (iPad / android) Thanks! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 22, 2014 Share Posted March 22, 2014 http://www.pandajs.net/docs/classes/game.System.html#attr_backgroundColor.game Try:game.System.backgroundColor.game = null;game.System.backgroundColor.rotate = null; Quote Link to comment Share on other sites More sharing options...
jcwhall Posted March 22, 2014 Author Share Posted March 22, 2014 Great thanks again. My bad, I should have properly read the API 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.