@@ -218,6 +218,37 @@ public ParticleSystem(Activity a, int maxParticles, Bitmap bitmap, long timeToLi
218
218
}
219
219
}
220
220
221
+ /**
222
+ * Utility constructor that receives an array of Bitmaps
223
+ *
224
+ * @param a The parent activity
225
+ * @param maxParticles The maximum number of particles
226
+ * @param bitmaps An array of bitmaps which will be randomly assigned to particles
227
+ * @param timeToLive The time to live for the particles
228
+ * @param parentViewId The view Id for the parent of the particle system
229
+ */
230
+ public ParticleSystem (Activity a , int maxParticles , Bitmap [] bitmaps , long timeToLive , int parentViewId ) {
231
+ this ((ViewGroup ) a .findViewById (parentViewId ), maxParticles , timeToLive );
232
+ for (int i =0 ; i <mMaxParticles ; i ++) {
233
+ mParticles .add (new Particle (bitmaps [mRandom .nextInt (bitmaps .length )]));
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Utility constructor that receives an array of Bitmaps
239
+ *
240
+ * @param parentView The parent view group
241
+ * @param maxParticles The maximum number of particles
242
+ * @param bitmaps An array of bitmaps which will be randomly assigned to particles
243
+ * @param timeToLive The time to live for the particles
244
+ */
245
+ public ParticleSystem (ViewGroup parentView , int maxParticles , Bitmap [] bitmaps , long timeToLive ) {
246
+ this (parentView , maxParticles , timeToLive );
247
+ for (int i =0 ; i <mMaxParticles ; i ++) {
248
+ mParticles .add (new Particle (bitmaps [mRandom .nextInt (bitmaps .length )]));
249
+ }
250
+ }
251
+
221
252
/**
222
253
* Utility constructor that receives an AnimationDrawable
223
254
*
0 commit comments