سؤال

I have an HTML game using the cocos 2D game engine and javascript. I have an image within the canvas, on clicking which I want the image to go full screen. Please don't confuse this question with doing this: http://jlongster.com/2011/11/21/canvas.html which I am able to reproduce just fine. The button is in the cocos canvas. Any help would be much appreciated.

هل كانت مفيدة؟

المحلول

So, I figured out the answer to my own question. The new Cocos-HTML5 has a nice API that makes your canvas full screen when you press a button:

if(coordinates are from the touch area)
{
    cc.Screen.getInstance().requestFullScreen(document.getElementById('<DIV ID in which your cocos canvas is embedded>'))
}

For more details check out: http://www.cocos2d-x.org/forums/19/topics/42564?r=42958#message-42958

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top