Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How add Multiple Images in Particles.js #106

Open
BehroozBvk opened this issue Mar 17, 2016 · 17 comments
Open

How add Multiple Images in Particles.js #106

BehroozBvk opened this issue Mar 17, 2016 · 17 comments

Comments

@BehroozBvk
Copy link

Hi, Wondering How add Multiple Images in Particles.js

@mikenewbon
Copy link

https://github.com/athletics/particles

@Koeroesi86
Copy link

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

@firestar300
Copy link

firestar300 commented Jan 8, 2019

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
    }
  ]
},

@chrisunderdown
Copy link

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?

@firestar300
Copy link

@chrisunderdown no I didn't.

@firestar300
Copy link

@chrisunderdown check the path of your images.

@TOcvfan
Copy link

TOcvfan commented Mar 1, 2019

I doesn't work for me

@Fenny
Copy link

Fenny commented Mar 7, 2019

@vjandrei
Copy link

vjandrei commented Mar 9, 2019

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
    }
  ]
},

@erichlotto
Copy link

erichlotto commented Mar 14, 2019

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

@firestar300
Copy link

firestar300 commented Mar 19, 2019

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
Copy link

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

@fogsy
Copy link

fogsy commented Apr 3, 2019

is multiple images working without react?

@salemalem
Copy link

is multiple images working without react?

Same question

@firestar300
Copy link

No it doesn't.

@dsusco
Copy link

dsusco commented Sep 18, 2019

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

#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.

@matteobruni
Copy link

matteobruni commented Jun 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

14 participants