topical media & game development

talk show tell print

#graphic-flex-image-effects-07-source-aether-effects-common-OverlayImageEffect.ax

#graphic-flex-image-effects-07-source-aether-effects-common-OverlayImageEffect.ax [swf] [flash] flex


  package aether.effects.common {
          
          import aether.effects.ImageEffect;
          
          import flash.display.BitmapData;
          import flash.geom.Matrix;
          import flash.geom.Point;
          
          public class @ax-graphic-flex-image-effects-07-source-aether-effects-common-OverlayImageEffect extends ImageEffect {
          
                  private var _image:BitmapData;
                  private var _matrix:Matrix;
                  
                  public function @ax-graphic-flex-image-effects-07-source-aether-effects-common-OverlayImageEffect(
                          image:BitmapData,
                          point:Point=null,
                          blendMode:String=null,
                          alpha:Number=1
                  ) {
                          init(blendMode, alpha);
                          if (point == null) {
                                  point = new Point();
                          }
                          _image = image;
                          _matrix = new Matrix();
                          _matrix.translate(point.x, point.y);
                  }
          
                  override protected function applyEffect(bitmapData:BitmapData):void {
                          bitmapData.draw(_image, _matrix);
                  }
          
          }
          
  }


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.