Expérimentations avec le Canvas

affichage-cartes-V.alpha
adplantade 5 years ago
parent 7fde11826f
commit bb9a36d669

@ -0,0 +1,24 @@
<canvas id="canvas" style="border:1px solid #000"></canvas>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
width=200;
height=200;
canvas.width=width;
canvas.height=height;
function faireCercle(x,y,color){
var cercle = new Path2D();
cercle.moveTo(x, y);
cercle.arc(x+25, y-25, 25, 0, 2 * Math.PI);
ctx.fillStyle = color;
ctx.fill(cercle);
}
faireCercle(50,50,"green");
faireCercle(50,100,"red");
</script>
Loading…
Cancel
Save