Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,37 @@ public ParticleSystem(Activity a, int maxParticles, Bitmap bitmap, long timeToLi
}
}

/**
* Utility constructor that receives an array of Bitmaps
*
* @param a The parent activity
* @param maxParticles The maximum number of particles
* @param bitmaps An array of bitmaps which will be randomly assigned to particles
* @param timeToLive The time to live for the particles
* @param parentViewId The view Id for the parent of the particle system
*/
public ParticleSystem(Activity a, int maxParticles, Bitmap[] bitmaps, long timeToLive, int parentViewId) {
this((ViewGroup) a.findViewById(parentViewId), maxParticles, timeToLive);
for (int i=0; i<mMaxParticles; i++) {
mParticles.add (new Particle (bitmaps[mRandom.nextInt(bitmaps.length)]));
}
}

/**
* Utility constructor that receives an array of Bitmaps
*
* @param parentView The parent view group
* @param maxParticles The maximum number of particles
* @param bitmaps An array of bitmaps which will be randomly assigned to particles
* @param timeToLive The time to live for the particles
*/
public ParticleSystem(ViewGroup parentView, int maxParticles, Bitmap[] bitmaps, long timeToLive) {
this(parentView, maxParticles, timeToLive);
for (int i=0; i<mMaxParticles; i++) {
mParticles.add (new Particle (bitmaps[mRandom.nextInt(bitmaps.length)]));
}
}

/**
* Utility constructor that receives an AnimationDrawble
*
Expand Down