topical media & game development

talk show tell print

#graphic-flex-image-effects-07-Flex-Textures.ax

#graphic-flex-image-effects-07-Flex-Textures.ax [swf] [flash] flex


  package {
  
          import aether.effects.common.CompositeEffect;
          import aether.effects.texture.TextureEffect;
          import aether.textures.natural.StoneTexture;
          import aether.textures.patterns.CheckerPattern;
          import aether.textures.synthetic.TileTexture;
  
          import flash.display.Bitmap;
          import flash.display.BitmapData;
          import flash.display.Sprite;
  
          [SWF(width=600, height=600, backgroundColor=0x000000)]
  
          
Demonstrates several built-in texture effects in aeon.

  
          public class @ax-graphic-flex-image-effects-07-Flex-Textures extends Sprite {
  
                  
Constructor. Draws bitmap data with several textures applied.

  
                  public function @ax-graphic-flex-image-effects-07-Flex-Textures() {
                          var bitmapData:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
                          new CompositeEffect(
                                  [
                                  new TextureEffect(
                                          new StoneTexture(bitmapData.width, bitmapData.height, 0xAAAAAA)
                                  ),
                                  new TextureEffect(
                                          new CheckerPattern(200, 200, 0xFF223333, 0x00000000)
                                  ),
                                  new TextureEffect(
                                          new TileTexture(200, 0, 0, 0, 4, 0, .5, true)
                                  )
                                  ]
                          ).apply(bitmapData);
                          addChild(new Bitmap(bitmapData));
                  }
  
          }
  
  }


(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.