drawcall / Proton

Javascript particle animation library
https://drawcall.github.io/Proton/
MIT License
2.42k stars 275 forks source link

Initial particle size #69

Open justjuank opened 4 years ago

justjuank commented 4 years ago

Hello, Is there a way to change the initial size of the particles so they don't look the same size when the emitter starts? I'm trying emitter.addInitialize(new Proton.Body(image, new Proton.Span(1, 100), new Proton.Span(1, 100))); but the size is always the same. Thanks in advance.

drawcall commented 4 years ago

You can use Proton.Scale Behaviour, it can achieve what you want

emitter.addBehaviour(new Proton.Scale(new Proton.Span(1, 5), 0.1));
justjuank commented 4 years ago

Oh interesting, that worked. I was trying to use Scale as: emitter.addBehaviour(new Proton.Scale(1, 5)); What is the second parameter for?