Flint Particle System Forum - Animated Particle using a series of BitmapData objects2011-10-16T22:30:27+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Animated Particle using a series of BitmapData objectshttp://flintparticles.org/forum/comments.php?DiscussionID=511&Focus=1705#Comment_17052011-08-29T01:22:25+01:002011-10-16T22:30:27+01:00Makotohttp://flintparticles.org/forum/account.php?u=360
I found that I could create an animated particle using a MovieClip with a series of frames containing the animation along with the displayObjectRenderer. Now while this works, I fear that it could ...
Animated Particle using a series of BitmapData objectshttp://flintparticles.org/forum/comments.php?DiscussionID=511&Focus=1707#Comment_17072011-08-30T08:30:15+01:002011-10-16T22:30:27+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
You'll need to customise the renderer to do this, but it shouldn't be too difficult. Take a look at the source code for the BitmapRenderer class, in particular the drawParticle method. You could ...
source code for the BitmapRenderer class, in particular the drawParticle method. You could create a custom renderer by extending the BitmapRenderer and overriding the drawParticle method (you shouldn't need to touch any other methods). The image property of the particle can be any object so make it a custom bitmap animation class and draw the current frame, and step to the next frame, in the drawParticle method of your renderer.]]>
Animated Particle using a series of BitmapData objectshttp://flintparticles.org/forum/comments.php?DiscussionID=511&Focus=1709#Comment_17092011-08-30T23:49:27+01:002011-10-16T22:30:27+01:00Makotohttp://flintparticles.org/forum/account.php?u=360
I'm assuming by your response that I'm correct in assuming that this method of animated particles will indeed be faster than the MovieClip route, yes?
Also, another reason I'm trying this method is ...
Also, another reason I'm trying this method is that my animation is derived from a sprite sheet that I divide up into BitmapData objects at runtime via copyPixels. My intent here is to get the fastest possible method of rendering animated particles and am wondering if this route will provide a definite speed increase. My attempts thus far have been at the particle level where I was using the the emitter's EMITTER_UPDATED event to step each particle's animation but haven't really noticed a speed increase. I'll give your method a go but wouldn't it be faster to just draw the BitmapData directly to the canvas and bypass code that has to manage another object?]]>
Animated Particle using a series of BitmapData objectshttp://flintparticles.org/forum/comments.php?DiscussionID=511&Focus=1710#Comment_17102011-08-31T21:14:50+01:002011-10-16T22:30:27+01:00Makotohttp://flintparticles.org/forum/account.php?u=360
Well here's the modification I came up with and it seems to faster than my other attempts.
I basically pass an Object of arrays containing the BitmapData sequences to the Renderer and use the ...
I basically pass an Object of arrays containing the BitmapData sequences to the Renderer and use the particle's dictionary to hold total frames, current frame, and type (a reference to which animation sequence in the Object passed into the Renderer). I don't know for sure if this increases performance or not but it seems in theory that it should.
image = _bitmaps[particle.dictionary.TYPE][particle.dictionary.CFRAME]; } else { matrix = particle.matrixTransform; } matrix.translate( -_canvas.x, -_canvas.y ); _bitmapData.draw( image, matrix, particle.colorTransform, DisplayObject( particle.image ).blendMode, null, _smoothing ); } } }]]>
Animated Particle using a series of BitmapData objectshttp://flintparticles.org/forum/comments.php?DiscussionID=511&Focus=1730#Comment_17302011-09-27T08:46:21+01:002011-10-16T22:30:27+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
Hi Makoto
Thank you for sharing this.
Richard
Thank you for sharing this.