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

documents on initialization lacking #25

Closed
ynkm169 opened this issue Jul 15, 2015 · 2 comments
Closed

documents on initialization lacking #25

ynkm169 opened this issue Jul 15, 2015 · 2 comments

Comments

@ynkm169
Copy link

ynkm169 commented Jul 15, 2015

the constructor

new ParticleSystem

should only be called after your view is loaded and positioned. Nothing is mentioned. Took me a while to find out.

If you do it inside activity construction, it will make emitter coordinates always 0,0
int[] location = new int[2];
emiter.getLocationInWindow(location);

@ynkm169
Copy link
Author

ynkm169 commented Jul 15, 2015

i changed it to this and now it is working...

@Override
public void onWindowFocusChanged (boolean hasFocus) {
    ViewGroup button = (ViewGroup) findViewById(R.id.emitterParent);
    for (int i = 0; i < button.getChildCount(); i++) {
        new ParticleSystem(this, 1000, R.drawable.particlestar, 600, R.id.drawingBg)        

        .emit(button.getChildAt(i), 50);
    };
}

@plattysoft
Copy link
Owner

Yes, it is explained in the response to issue #22 and #21

Maybe it is a good idea to add it to the documentation.

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