Flint Particle System Forum - Passing properties when using ImageClasses2011-12-10T22:43:58+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Passing properties when using ImageClasseshttp://flintparticles.org/forum/comments.php?DiscussionID=457&Focus=1551#Comment_15512011-02-17T16:35:50+00:002011-02-20T01:01:10+00:00FlashDev2007http://flintparticles.org/forum/account.php?u=460
I am using the following intializer code which says to use one of these 3 classes (simple Shapes) and I want 1 Rect for every 10 Circles.
addInitializer(new ImageClasses([Rect, Circle, ...
addInitializer(new ImageClasses([Rect, Circle, Ring],[1,10]));
The shapes take a color param in their constructor, at present I am randomizing the color in a base class for each shape. Is it possible to pass in parameters to their constructors? Or even better is there a way to pass in a new ImageClass for each item in the array to ImageClasses?]]>
Passing properties when using ImageClasseshttp://flintparticles.org/forum/comments.php?DiscussionID=457&Focus=1554#Comment_15542011-02-20T01:00:26+00:002011-12-10T22:43:58+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
You can pass an array instead of a simple class, then the first item in the array should be the class, and the other items the parameters for the constructor. For example
addInitializer(new ...
addInitializer(new ImageClasses([ [Rect, 5, 10], [Circle, 5], [Ring, 3, 5] ], [1, 10, 1] ));
I'm not sure what you're asking with the second part of your question. Would you try explaining again.]]>
Passing properties when using ImageClasseshttp://flintparticles.org/forum/comments.php?DiscussionID=457&Focus=1558#Comment_15582011-02-21T17:07:53+00:002011-12-10T22:43:58+00:00FlashDev2007http://flintparticles.org/forum/account.php?u=460
I just needed to pass in params to each constructor, and couldn't see how it was done, thank you. Ignore the second part this will do nicely.
Passing properties when using ImageClasseshttp://flintparticles.org/forum/comments.php?DiscussionID=457&Focus=1573#Comment_15732011-03-02T16:34:15+00:002011-12-10T22:43:58+00:00killerspazhttp://flintparticles.org/forum/account.php?u=474
Hmm this is interesting... I was looking at ImageClasses and SharedImages...
It seemed to me SharedImages was for passing instances of DisplayObject, and ImageClasses was for passing classes - so ...
It seemed to me SharedImages was for passing instances of DisplayObject, and ImageClasses was for passing classes - so which would be more appropriate? In my mind his use case would warrant SharedImages usage - but again I didn't realize ImageClasses took such complex (and untyped) input.
Just my 2 cents, I've been having so much fun playing with Flint - and I've even built my own particle systems in AS3! Just trying to get a better handle on your framework (which is much more friendly than others I've used/implemented)!]]>
Passing properties when using ImageClasseshttp://flintparticles.org/forum/comments.php?DiscussionID=457&Focus=1576#Comment_15762011-03-06T15:32:02+00:002011-12-10T22:43:58+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
In general, SharedImage and SharedImages are more suitable if you're using a BitmapRenderer, since this renderer can share a single display object between multiple particles. ImageClass and ...