<!doctype html>
<html>
<head>
<title>Game</title>
<style media="screen" type="text/css">
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
#canvas {
position: absolute;
}
</style>
<!-- <meta charset="utf-8" content="width=device-width, initial-scale=1.0"> -->
<!-- <meta charset="utf-8"> -->
<!-- <meta charset="utf-8" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> -->
</head>
<body>
<canvas id="canvas">
Your browser needs to support canvas to play this game!
</canvas>
<!-- Include libraries -->
<script type="text/javascript" src="js/pentagine/build/pentagine.js"></script>
<script type="text/javascript" src="js/cp.min.js"></script>
<!-- Include game classes -->
<script type="text/javascript" src="js/MenuState.js"></script>
<script type="text/javascript" src="js/Block.js"></script>
<script type="text/javascript" src="js/Constants.js"></script>
<script type="text/javascript" src="js/Utils.js"></script>
<script type="text/javascript" src="js/ScoreState.js"></script>
<script type="text/javascript" src="js/PlayState.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
相关行是 CSS 和这些:
<!-- <meta charset="utf-8" content="width=device-width, initial-scale=1.0"> -->
<!-- <meta charset="utf-8"> -->
<!-- <meta charset="utf-8" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> -->
我想让我的画布占据尽可能多的屏幕。我希望我的画布是全屏的,这曾经在 Firefox、Chromium 和 Firefox OS 上都可以正常工作,但现在它似乎无法正常工作。我需要帮助找出 CSS 和content=""
标签来制作画布(因此画布context.width
和context.height
占用尽可能多的空间。