Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorjonnie
- CommentTimeJan 22nd 2010
Hello everybody! First of all, I'd like to thank Richard Lord for such an amazing bit of work creating the Flint particle system - I'm expecting it to come in very handy for my current project!
Now here's my problem...
I've been experimenting with the "Explode Image" example files, and I'm having a bit of trouble. In particular, it is this line of code that is stumping me:
var particles:Array = Particle2DUtils.createRectangleParticlesFromBitmapData( new Image1(384,255), 10, emitter.particleFactory, 56, 47 );
I have created my own Flash file which is almost identical to that of the example file, except for that it uses a different image. When I test the movie, the image that I have decided to use is massive, and some of it extends out of the visible stage area. I've tried re-sizing the image by changing the values of "Image1(384,255)" to something smaller, but it has no effect.
Am I just going to have to alter the size of the original image in Photoshop?
Thanks in advance. -
- CommentAuthorjonnie
- CommentTimeJan 22nd 2010
Okay I sorted the image size by just adjusting it in Photoshop.
Got a few other things that I'd be interested in knowing about though!
I'd like to add a gravitational and fade-to-alpha effect to the particles. I'd also be interested to know how easy it is to convert this code so that the image explodes when another particle makes contact with it or when a movie clip or cursor makes contact with it. I'm also going to want the image to be moving from the right side of the screen to the left - does this just involve placing it into an empty movie clip and then moving it in the timeline or is it a little more complicated than this?
Look forward to anything anyone has to say on the matter.
Thanks again :) -
- CommentAuthorRichard
- CommentTimeJan 25th 2010
Hi Jonnie
The dimensions, 384, 255, are the size of the Bitmap asset in the library. They're not used to resize the image, but rather to tell flash how large the image is.
For your other questions, add additional Actions to the emitter to cause the particles to fade or behave in other ways. If you only want these to occur after the explosion, add them in the explode method. The explosion happens when the explode method is called. You can use any event to trigger this, and you can change the contents to set the x and y of the explosion to whatever values you want - the coordinates of another MovieClip, for example.
Richard -
- CommentAuthorjonnie
- CommentTimeJan 27th 2010
Thanks a lot for your reply.
I've also been thinking about ways that this code could be manipulated to achieve other effects... Would it be possible that the fragments of the image could be sucked towards the cursor rather than blown apart on a mouse click?
By that I mean when the cursor gets within a certain distance of the image, the fragments start to become attracted to it?
Thanks again, Richard.
Jonnie. -
- CommentAuthorRichard
- CommentTimeFeb 9th 2010
Yes, by using something like the MouseGravity action.
1 to 5 of 5
