examples/doc_ring.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="/js/spritejs.js"></script>
<script src="//lib.baomitu.com/dat-gui/0.7.2/dat.gui.min.js"></script>
<style>
#adaptive {
width: 100%;
padding-bottom: 50%;
background: #eee;
}
</style>
</head>
<body>
<div id="adaptive"></div>
<script>
const {Scene, Ring} = spritejs;
const container = document.getElementById('adaptive');
const scene = new Scene({
container,
width: 1200,
height: 600,
// contextType: '2d',
});
const layer = scene.layer();
const ring = new Ring({
pos: [300, 300],
innerRadius: 50,
outerRadius: 100,
fillColor: 'blue',
startAngle: 270,
endAngle: 90,
});
layer.append(ring);
const ring2 = ring.cloneNode();
ring2.attr({
pos: [700, 300],
startAngle: 0,
endAngle: 360,
fillColor: 'red',
});
layer.append(ring2);
</script>
</body>
</html>