plattysoft / Leonids

A Particle System for standard Android UI: http://plattysoft.github.io/Leonids/
Apache License 2.0
2.28k stars 396 forks source link

Particle always start from the Top Left point of the screen #18

Closed hateum closed 9 years ago

hateum commented 9 years ago

Thanks for this lib, it's really impressionnate.

I always have the particle emitted from the top-left point on the screen, how can I configure the particle system to make some particles float on the screen randomly.

plattysoft commented 9 years ago

Particles start from the center of the view they use as anchor. You can make them start from one of the sides or one of the corners by using emitWithGravity.

That being said, a particle system needs to have an emitting point (or line) once you know which one you want in your case, it should be easy to put a view in that position and make it work as you want

plattysoft commented 9 years ago

That is a static image.

hateum commented 9 years ago

Sorry, I haven't an animated Gif, I have only this picture. The animation is : these masks float from the depth to the front and leaves the screen. Can your library do this ?

plattysoft commented 9 years ago

As I said before:

Are they spawning from a specific position (be it a point or a line)? Then yes.

Otherwise it could still be done but it won't be a particle system per se and you'd need to touch the code on the library itself.

hateum commented 9 years ago

No, they not spawning from a specific position, they do from random position. Can you tell me what fonction I need to change ?

plattysoft commented 9 years ago

You can take a look at emitWithGravity to see how it gets spread over a line and make it a combination of the horizontal and vertical spreading so the particles get emitted from a square.