forked from konvajs/konva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotate-star.html
57 lines (47 loc) · 1.03 KB
/
rotate-star.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
canvas {
border: 1px solid #9C9898;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="../../dist/konva-dev.js"></script>
<script src="../lib/stats.js"></script>
<script src="../setStats.js"></script>
<script>
var stage = new Konva.Stage({
container: 'container',
width: 500,
height: 500
});
var layer = new Konva.Layer();
var star = new Konva.Star({
x: 250,
y: 250,
innerRadius: 100,
outerRadius: 200,
numPoints: 500,
fill: 'yellow',
stroke: 'black',
strokeWidth: 4,
name: 'myCircle',
draggable: true
});
layer.add(star);
stage.add(layer);
var anim = new Konva.Animation(function() {
stats.begin();
star.rotate(0.1);
}, layer);
anim.start();
</script>
</body>
</html>