Change particle link distance on interval #2259
-
with Particles.js i was able to vary the line link distance on an interval as seen below. How do I achieve this same effect? Basically is looks like no links and increases to heavily linked points then back to minimal links. repeat...
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @joedecerce, This is a difficult trick to do programmatically since each particle has its own options and values, links are set on particles too. This is because you can have particles without links or with different ids. If you have 30 particles with link id A and 30 particles with link id B they will only link with the same link id, this is useful when using particles groups or emitters. If you want to change the distance you have to update each particle link distance. But there's a plugin system inside tsParticles and you can create something like this:
This is the addPlugin parameter interface: https://github.com/matteobruni/tsparticles/blob/main/engine/src/Core/Interfaces/IPlugin.ts This is the getPlugin return value: https://github.com/matteobruni/tsparticles/blob/main/engine/src/Core/Interfaces/IContainerPlugin.ts This is the delta object: https://github.com/matteobruni/tsparticles/blob/main/engine/src/Core/Interfaces/IDelta.ts If you have more questions or need more help, I'm here I created a working sample here: https://codepen.io/matteobruni/pen/LYLJeqJ |
Beta Was this translation helpful? Give feedback.
Hi @joedecerce,
This is a difficult trick to do programmatically since each particle has its own options and values, links are set on particles too. This is because you can have particles without links or with different ids.
If you have 30 particles with link id A and 30 particles with link id B they will only link with the same link id, this is useful when using particles groups or emitters.
If you want to change the distance you have to update each particle link distance.
But there's a plugin system inside tsParticles and you can create something like this: