| Package | com.joebillman.fx |
| Class | public class Reflection |
| Inheritance | Reflection flash.display.Sprite |
| Property | Defined By | ||
|---|---|---|---|
| filters : Array [override] [write-only]
Sets the filters array reflection
| Reflection | ||
| maskHeight : Number [write-only]
Sets the height of the mask
| Reflection | ||
| maskPaddingX : Number [write-only]
Sets the horizontal padding of the mask. | Reflection | ||
| maskPaddingY : Number [write-only]
Sets the vertical padding of the mask
| Reflection | ||
| spread : Array [write-only]
Sets the spread array for the mask gradient
| Reflection | ||
| target : DisplayObject [write-only]
Sets the target for the reflection
| Reflection | ||
| transparency : Array [write-only]
Sets the transparency array for the mask gradient
| Reflection | ||
| Method | Defined By | ||
|---|---|---|---|
Reflection(target:DisplayObject) | Reflection | ||
cleanUp():void
Removes the mask and bitmap and marks them for deletion via the garbage collector
| Reflection | ||
redraw():void
Calls the cleanUp function and redraws the bitmap and mask
| Reflection | ||
| filters | property |
filters:Array [write-only] [override] Sets the filters array reflection
The default value is [].
public function set filters(value:Array):void| maskHeight | property |
maskHeight:Number [write-only] Sets the height of the mask
The default value is target.height/2.
public function set maskHeight(value:Number):void| maskPaddingX | property |
maskPaddingX:Number [write-only] Sets the horizontal padding of the mask. Most useful for text
The default value is 0.
public function set maskPaddingX(value:Number):void| maskPaddingY | property |
maskPaddingY:Number [write-only] Sets the vertical padding of the mask
The default value is 0.
public function set maskPaddingY(value:Number):void| spread | property |
spread:Array [write-only] Sets the spread array for the mask gradient
The default value is [0, 127, 255].
public function set spread(value:Array):void| target | property |
target:DisplayObject [write-only] Sets the target for the reflection
public function set target(value:DisplayObject):void| transparency | property |
transparency:Array [write-only] Sets the transparency array for the mask gradient
The default value is [.75, .55, 0].
public function set transparency(value:Array):void| Reflection | () | Constructor |
public function Reflection(target:DisplayObject)Parameters
target:DisplayObject — Display object of which to make a reflection
|
| cleanUp | () | method |
public function cleanUp():voidRemoves the mask and bitmap and marks them for deletion via the garbage collector
| redraw | () | method |
public function redraw():voidCalls the cleanUp function and redraws the bitmap and mask
Note: Due to an issue with the BitmapData class the target DisplayObject must have a top-left registration point of 0,0
var reflection:Reflection;
var shape:Shape = new Shape();
var gr:Graphics = shape.graphics;
gr.beginFill(0xFF0000);
gr.drawRect(0, 0, 50, 50)
gr.endFill();
addChild(shape);
reflection = new Reflection(shape);
addChild(reflection);