-
Notifications
You must be signed in to change notification settings - Fork 1
/
spinningApple.html
35 lines (32 loc) · 944 Bytes
/
spinningApple.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!--
Author: Josh Gillham
Version: 9-26-12
Descriptio:
Draws an apple image onto the canvas.
Ensure that apple.bmp is in the same folder.
-->
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Raster</title>
<!-- Load Paper.js libray -->
<script type="text/javascript" src="paper.js"></script>
<!-- Start Paperscript -->
<script type="text/paperscript" canvas="myCanvas">
// Load the apple image
var img= new Raster( 'apple' );
// Put it in the center of the canvas
img.position= view.bounds.center;
function onFrame() {
img.rotate( 0.1 );
}
</script>
</head>
<body>
<!-- Link the canvas -->
<canvas id="myCanvas" resize=""></canvas>
<!-- Embed the image resource -->
<img style="width: 32px; height: 32px; Display: none;" alt="" src="apple.bmp" id="apple">
</body>
</html>