Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorcon.cept.me
- CommentTimeFeb 10th 2010
If I add a filter like this?
var colorMatrix:ColorMatrixFilter = new ColorMatrixFilter( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0.99, 0 ] );
renderer.addFilter( colorMatrix);
How can i tween it?
renderer.filters always seem to stay empty.. but i can see it in: renderer.postFilters
If I use Gtween something like:
ColorAdjustPlugin.install();
new GTween(renderer, 3, {saturation:-100, contrast:70}, {repeatCount:0, reflect:true});
Does not work.. how I can access the object with the filter ? -
- CommentAuthorRichard
- CommentTimeFeb 10th 2010 edited
The filters are, as you say, stored in the postFilters (default) or preFilters arrays. Every frame, they are applied to the bitmapData object used to render the particles. If you wish to modify a filter, you don't have to jump through the usual Actionscript hoops of copying the filters array, modifying it, then applying it back. You just alter your filter. The postFilters array contains a reference to your filter so will catch the modifications and apply it accordingly. So you need only alter the matrix property of your ColorMatrixFilter to alter its application in the renderer. e.g.colorMatrix.matrix = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0.98, 0 ];
I don't know if or how you would do this with GTween. -
- CommentAuthorcon.cept.me
- CommentTimeFeb 11th 2010
Ah ok.. thx.. actually Gtween has some helper functions to make it easier but it only works on the object where it is added to the .filters array.. Is there anyway to expose this object they are the particles itself right ? -
- CommentAuthorRichard
- CommentTimeFeb 13th 2010
They're not added to any object's filters array. They are applied directly to the BitmapData object.
1 to 4 of 4
