I've been looking for a way to make my Cocos2D-JS app go into fullscreen mode, but there doesn't seem to be much documentation on Cocos2D-JS (or Cocos2D-x-js as some seem to call it.) This app is to be exported into a Windows Desktop platform (Win32), and so fullscreen mode should work there as well.
I checked the Cocos2D-JS Online API and found cc.screen, which has a method called requestFullScreen
, so I tried this:
cc.screen.requestFullScreen(document.documentElement, function() { cc.log('Requesting full screen...'); } );
However, this didn't work on either of the platforms I tested it on (web browser and win32). Since document
does not exist when you export the app into win32, I then tried changing it for cc._canvas
:
cc.screen.requestFullScreen(cc._canvas, function() { cc.log('Requesting full screen...'); } );
But this did not work either. Is there a way to make the app run in fullscreen mode?
PD: My apologies for any wrong tags I may have included to this question. I added the ones I thought were related to this problem.