tsParticles additional squircle shape.
@tsparticles/engine (or use the CDN bundle below)tsParticles.load(...)tsParticles.load(...) configThe CDN/Vanilla version JS has one required file in vanilla configuration:
Including the tsparticles.shape.squircle.min.js file will export the function to load the shape:
loadSquircleShape
Once the scripts are loaded you can set up tsParticles and the shape like this:
(async () => {
await loadSquircleShape(tsParticles);
await tsParticles.load({
id: "tsparticles",
options: {
/* options */
/* here you can use particles.shape.type: "squircle" */
},
});
})();
This package is compatible also with ES or CommonJS modules, firstly this needs to be installed, like this:
$ npm install @tsparticles/shape-squircle
or
$ yarn add @tsparticles/shape-squircle
Then you need to import it in the app, like this:
const { tsParticles } = require("@tsparticles/engine");
const { loadSquircleShape } = require("@tsparticles/shape-squircle");
(async () => {
await loadSquircleShape(tsParticles);
})();
or
import { tsParticles } from "@tsparticles/engine";
import { loadSquircleShape } from "@tsparticles/shape-squircle";
(async () => {
await loadSquircleShape(tsParticles);
})();
particles.shape.type: "squircle"particles.shape.options.squircle{
"particles": {
"shape": {
"type": "squircle",
"options": {
"squircle": {}
}
}
}
}
tsParticles.load(...) before loadSquircleShape(...)