V
V
Vlados Landos2019-04-11 17:20:19
JavaScript
Vlados Landos, 2019-04-11 17:20:19

Why do particles on canvas go crazy with a transparent background?

Hello everyone, I want to make a transparent background in canvas so that I can embed it on my website.
https://codepen.io/borian/pen/oKwGA is the culprit
As soon as I change context.fillStyle = "#00000" to context.fillStyle = "rgba(0,0,0,0)", the particles turn into lines. Why? How can I fix this? Or tell me some other solution / script / engine. The goal is a transparent background for the canvas with a sphere of particles. By the way, I noticed exactly the same problem on other particle codepenes.5caf4ce6c9557910914633.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ProjectSoft, 2019-04-11
@whatslve

//background fill
context.clearRect(0,0,displayWidth,displayHeight);
context.fillStyle = "rgba(0,0,0,0)";
context.fillRect(0,0,displayWidth,displayHeight);

And there will be happiness

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question