Commit 9e3b3e0e by doszhang

dos

parent 72342805
...@@ -115,7 +115,6 @@ function paint() { ...@@ -115,7 +115,6 @@ function paint() {
// ctx.fillStyle = "rgba(0,0,0,0.1)"; // ctx.fillStyle = "rgba(0,0,0,0.1)";
var img = new Image(); var img = new Image();
img.src = '/Public/static/image2/fireworkbg.jpg' img.src = '/Public/static/image2/fireworkbg.jpg'
img.onload = function () {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height); ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
ctx.fillRect(0, 0, w, h); ctx.fillRect(0, 0, w, h);
ctx.globalCompositeOperation = 'lighter'; ctx.globalCompositeOperation = 'lighter';
...@@ -123,6 +122,8 @@ function paint() { ...@@ -123,6 +122,8 @@ function paint() {
for (var i = 0; i < particles.length; i++) { for (var i = 0; i < particles.length; i++) {
particles[i].draw(ctx); particles[i].draw(ctx);
} }
img.onload = function () {
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment