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

setScaleRange not working for oneShot #5

Closed
afehners opened this issue Oct 9, 2014 · 4 comments
Closed

setScaleRange not working for oneShot #5

afehners opened this issue Oct 9, 2014 · 4 comments

Comments

@afehners
Copy link

afehners commented Oct 9, 2014

The following code results in a particle effect where the size of the image remains fixed, when it is expected to vary in scale from 0.2 to 1.

ParticleSystem stars = new ParticleSystem(me, 50, R.drawable.star_particle, 2000);
stars.setScaleRange(0.2f, 5f);
stars.setSpeedRange(0.3f, 1f);
stars.oneShot(dials, 50);

@plattysoft
Copy link
Owner

ScaleRange is the range of sizes when shot, not that they grow from 0.2 to 5.

In fact when you use that code, you should see how the particles spawned are different in size.

What you want to do is performed by a Modifier, specifically a ScaleModifier

addModifier(new ScaleModifier(0.2f, 5f, 0, 200))

You can see how it works on the example StarsExampleActivity

https://github.com/plattysoft/Leonids/blob/master/LeonidasExamples/src/com/plattysoft/leonids/examples/StarsExampleActivity.java

@afehners
Copy link
Author

afehners commented Oct 9, 2014

Thanks for the info. However I'm not trying to get the images to change size over their lifetime. I'm trying to get a range of sizes when the particles are created.
With the code shown all my particles are created at the same size.

@plattysoft
Copy link
Owner

Ah, sorry, I misread the issue. Then you are using it right.

I'm not sure I ever tried that specific combination, so I'll take a look.

@plattysoft plattysoft reopened this Oct 9, 2014
@plattysoft
Copy link
Owner

I just fixed it, I have not made it into a release, so if you are in a hurry, just get the latest version and export the jar.
I expect to release it sometime next week.
Thanks for the heads up!

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

2 participants