[英]Make a cocos HTML game go full screen by pressing a button within the canvas
我有一個使用cocos 2D游戲引擎和javascript的HTML游戲。 我在畫布中有一個圖像,單擊后我希望該圖像全屏顯示。 請不要將此問題與此問題混淆: http : //jlongster.com/2011/11/21/canvas.html我可以復制的很好。 該按鈕在 cocos畫布中。 任何幫助將非常感激。
因此,我想出了我自己問題的答案。 新的Cocos-HTML5具有一個不錯的API,當您按下按鈕時,可使畫布全屏顯示:
if(coordinates are from the touch area)
{
cc.Screen.getInstance().requestFullScreen(document.getElementById('<DIV ID in which your cocos canvas is embedded>'))
}
有關更多詳細信息,請訪問: http : //www.cocos2d-x.org/forums/19/topics/42564?r=42958#message-42958
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.