Posted By

Energy304 on 02/25/14


Tagged

web canvas


Versions (?)

Canvas


 / Published in: HTML
 

Responsive Canvas Intel XDK

  1. <!DOCTYPE html><!--HTML5 doctype-->
  2. <title>Your New Application</title>
  3. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
  5. <style type="text/css">
  6. /* Prevent copy paste for all elements except text fields */
  7. * { -webkit-user-select:none; -webkit-tap-highlight-color:rgba(255, 255, 255, 0); margin:0; padding:0; }
  8. input, textarea { -webkit-user-select:text; }
  9. html, body { background-color:red; color:black; width:100%; height:100%;}
  10. canvas{background-color: #333; position: relative; display:block;}
  11. </style>
  12. <script src='intelxdk.js'></script>
  13. <script type="text/javascript">
  14. /* This code is used to run as soon as Intel activates */
  15. var onDeviceReady=function(){
  16. //hide splash screen
  17. intel.xdk.device.hideSplashScreen();
  18. };
  19. document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
  20. </script>
  21. </head>
  22. <canvas id="game"></canvas>
  23. var canvas = document.getElementById("game");
  24. var ctx = canvas.getContext("2d");
  25. canvas.width = window.innerWidth;
  26. canvas.height = window.innerHeight;
  27. </script>
  28. </body>
  29. </html>

Report this snippet  

You need to login to post a comment.