particles.js icon indicating copy to clipboard operation
particles.js copied to clipboard

How add Multiple Images in Particles.js

Open BehroozBvk opened this issue 8 years ago • 18 comments

Hi, Wondering How add Multiple Images in Particles.js

BehroozBvk avatar Mar 17 '16 09:03 BehroozBvk

https://github.com/athletics/particles

mikenewbon avatar Mar 30 '17 15:03 mikenewbon

This seems like a sad story so far: https://github.com/VincentGarreau/particles.js/blob/master/particles.js#L380

Koeroesi86 avatar Jun 09 '18 19:06 Koeroesi86

any updates in 2018??

mohammedgqudah avatar Aug 15 '18 15:08 mohammedgqudah

It works using https://github.com/Wufe/react-particles-js

"shape": {
  "type": "images",
  "stroke": {
    "width": 0,
    "color": "#000"
  },
  "polygon": {
    "nb_sides": 6
  },
  "images": [
    {
      "src": "img/shapes/0.svg",
      "width": 100,
      "height": 100
    },
    {
      "src": "img/shapes/1.svg",
      "width": 100,
      "height": 100
    }
  ]
},

firestar300 avatar Jan 08 '19 08:01 firestar300

It works !

"shape": {
  "type": "images",
  "stroke": {
    "width": 0,
    "color": "#000"
  },
  "polygon": {
    "nb_sides": 6
  },
  "images": [
    {
      "src": "img/shapes/0.svg",
      "width": 100,
      "height": 100
    },
    {
      "src": "img/shapes/1.svg",
      "width": 100,
      "height": 100
    }
  ]
},

Doesn't work for me? Did you make any changes to particles.js?

chrisunderdown avatar Feb 20 '19 19:02 chrisunderdown

@chrisunderdown no I didn't.

firestar300 avatar Feb 20 '19 20:02 firestar300

@chrisunderdown check the path of your images.

firestar300 avatar Feb 21 '19 22:02 firestar300

I doesn't work for me

TOcvfan avatar Mar 01 '19 13:03 TOcvfan

@firestar300 are you using https://github.com/VincentGarreau/particles.js ?

Fenny avatar Mar 07 '19 04:03 Fenny

not working here either

It works !

"shape": {
  "type": "images",
  "stroke": {
    "width": 0,
    "color": "#000"
  },
  "polygon": {
    "nb_sides": 6
  },
  "images": [
    {
      "src": "img/shapes/0.svg",
      "width": 100,
      "height": 100
    },
    {
      "src": "img/shapes/1.svg",
      "width": 100,
      "height": 100
    }
  ]
},

vjandrei avatar Mar 09 '19 19:03 vjandrei

Any updates on this? Are there other libraries available that works? (https://github.com/athletics/particles doesn't work on firefox)

erichlotto avatar Mar 14 '19 17:03 erichlotto

It's very weird. I used theses settings in production : https://100.iccwbo.org/

As you can see, there are several SVG path in background. @Fenny , I used the React component of ParticleJS https://www.npmjs.com/package/react-particles-js

firestar300 avatar Mar 19 '19 11:03 firestar300

Upon further investigation, images shape type only works on the React component of ParticleJS. https://github.com/Wufe/react-particles-js/blob/master/src/lib/Particle.ts

firestar300 avatar Mar 20 '19 13:03 firestar300

is multiple images working without react?

fogsy avatar Apr 03 '19 22:04 fogsy

is multiple images working without react?

Same question

salemalem avatar Apr 07 '19 13:04 salemalem

No it doesn't.

firestar300 avatar Apr 08 '19 20:04 firestar300

I created a PR for multiple images. Just make particles.shape.image an array.

https://github.com/VincentGarreau/particles.js/pull/390

It includes another PR for a "destroy" out mode. I needed multi-colored balloons to fly off the top of the screen. You know... important website stuff.

dsusco avatar Sep 18 '19 14:09 dsusco

If anyone needs this feature this library has it, it's the new core of react-particles-js but React is not required, it's a library like particles.js

matteobruni avatar Jun 04 '20 08:06 matteobruni