HTML and CSS Reference
In-Depth Information
context . arc ( x , y , 15 , 0 , Math . PI * 2 , true
true );
context . closePath ();
context . fill ();
}
theCanvas = document . getElementById ( "canvasOne" );
context = theCanvas . getContext ( "2d" );
var
var speed = 5 ;
var
var y = 10 ;
var
var x = 250 ;
function
function gameLoop () {
window . setTimeout ( gameLoop , 20 );
drawScreen ()
}
gameLoop ();
}
< /script>
</head>
</head>
<body>
<body>
<div
<div style= "position: absolute; top: 50px; left: 50px;" >
<canvas
<canvas id= "canvasOne" width= "500" height= "500" >
Your browser does not support HTML5 Canvas.
</canvas>
</canvas>
</div>
</div>
</body>
</body>
</html>
</html>
NOTE
The basic structure of the HTML for all the examples in this chapter will follow these rules. In the
interest of saving space, we will refrain from discussing this code further, but it will appear in the
examples provided.
Search WWH ::




Custom Search