3 <title>Canvas - Single Image
</title>
9 <script type=
"text/javascript" src=
"bench.js"></script>
10 <script type=
"text/javascript" src=
"sprites.js"></script>
11 <script type=
"text/javascript">
14 var NUM_SPRITES
= 2000;
19 canvas
= document
.getElementById('canvas');
20 context
= canvas
.getContext('2d');
22 sprites
.init(canvas
.width
, canvas
.height
);
23 var image
= document
.getElementById('sprite-cache').children
[0];
24 for (var i
= 0; i
< NUM_SPRITES
; ++i
) {
32 context
.clearRect(0, 0, canvas
.width
, canvas
.height
);
33 sprites
.draw(context
);
39 <canvas id=
"canvas" width=
"800" height =
"600">
40 <div id=
"sprite-cache">
41 <img src=
"images/image1_t.png" />