Closed ynkm169 closed 9 years ago
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);
};
}
Yes, it is explained in the response to issue #22 and #21
Maybe it is a good idea to add it to the documentation.
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);