【实例截图】
【核心代码】
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>疯狂的方块</title> <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="game-id" content="colorsquare" /> <meta name="full-screen" content="true"/> <meta name="screen-orientation" content="portrait"/> <meta name="x5-fullscreen" content="true"/> <meta name="360-fullscreen" content="true"/> <style> body { text-align: center; background: #000000; padding: 0; border: 0; margin: 0; height: 100%; } html { -ms-touch-action: none; /* Direct all pointer events to JavaScript code. */ } .aliForPc {display:none;position:fixed;top:5px;right:5px;width:200px;height:230px;overflow:hidden;z-index:99999;} </style> <script src='http://libs.baidu.com/jquery/1.9.0/jquery.js' type='text/javascript'></script> </head> <body> <div style="display:inline-block;width:100%; height:100%;margin: 0 auto; background: black; position:relative;" id="gameDiv"> <canvas id="gameCanvas" width="480" height="640" style="background-color: #000000"></canvas> </div> <script>var document_class = "GameApp";</script> <script src="js/game-min.js?ver"></script> <script src="js/egret_require.js?ver"></script> <script src="js/egret_loader.js?ver"></script> <script> egret_h5.startGame(); </script> </body> </html>