Rysowanie gwiazdy
Strona używa skryptu figures.js
Listing
var cv = document.getElementById("canvas"); var ctx = cv.getContext("2d"); //- var star1 = new Star(new Point(50, 100), 100, 20, 5); star1.lineWidth = 1; star1.strokeStyle = "red"; star1.stroke = true; star1.draw(ctx); //- var star2 = new Star(new Point(200, 100), 100, 30, 6); star2.fillStyle = "red"; star2.fill = true; star2.draw(ctx); // var star3 = new Star(new Point(350, 100), 100, 10, 5); star3.lineWidth = 5; star3.strokeStyle = "blue"; star3.fillStyle = "red"; star3.stroke = true; star3.fill = true; star3.draw(ctx); // var star4 = new Star(new Point(50, 300), 100, 10, 10); star4.lineWidth = 5; star4.fillStyle = "yellow"; star4.fill = true; star4.draw(ctx); // var star5 = new Star(new Point(200, 300), 80, 5, 30); star5.fillStyle = "green"; star5.fill = true; star5.draw(ctx); // var star6 = new Star(new Point(350, 300), 60, 50, 40); star6.lineWidth = 3; star6.fillStyle = "magenta"; star6.strokeStyle = "blue"; star6.stroke = true; star6.fill = true; star6.draw(ctx);