Packagestarling.filters
Classpublic class DropShadowFilter
InheritanceDropShadowFilter Inheritance FragmentFilter Inheritance EventDispatcher Inheritance Object

The DropShadowFilter class lets you add a drop shadow to display objects. To create the shadow, the class internally uses the BlurFilter.



Public Properties
 PropertyDefined By
  alpha : Number
The alpha value of the shadow.
DropShadowFilter
 InheritedalwaysDrawToBackBuffer : Boolean
Indicates if the last filter pass is always drawn directly to the back buffer.
FragmentFilter
  angle : Number
The angle with which the shadow is offset, in radians.
DropShadowFilter
  blur : Number
The amount of blur with which the shadow is created.
DropShadowFilter
  color : uint
The color of the shadow.
DropShadowFilter
  distance : Number
The offset distance for the shadow, in points.
DropShadowFilter
 InheritedisCached : Boolean
[read-only] Indicates if the filter is cached (via the cache method).
FragmentFilter
 InheritednumPasses : int
[read-only] Indicates the number of rendering passes required for this filter.
FragmentFilter
 Inheritedpadding : Padding
Padding can extend the size of the filter texture in all directions.
FragmentFilter
  resolution : Number
[override]
DropShadowFilter
 InheritedtextureFormat : String
The format of the filter texture.
FragmentFilter
 InheritedtextureSmoothing : String
The smoothing mode of the filter texture.
FragmentFilter
Protected Properties
 PropertyDefined By
 Inheritedeffect : FilterEffect
[read-only] The effect instance returning the FilterEffect created via createEffect.
FragmentFilter
 InheritedindexData : IndexData
[read-only] The IndexData used to process the effect.
FragmentFilter
 InheritedvertexData : VertexData
[read-only] The VertexData used to process the effect.
FragmentFilter
Public Methods
 MethodDefined By
  
DropShadowFilter(distance:Number = 4.0, angle:Number = 0.785, color:uint = 0x0, alpha:Number = 0.5, blur:Number = 1.0, resolution:Number = 0.5)
Creates a new DropShadowFilter instance with the specified parameters.
DropShadowFilter
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
 Inherited
cache():void
Caches the filter output into a texture.
FragmentFilter
 Inherited
clearCache():void
Clears the cached output of the filter.
FragmentFilter
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
  
dispose():void
[override] Disposes all resources that have been created by the filter.
DropShadowFilter
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
 Inherited
process(painter:Painter, helper:IFilterHelper, input0:Texture = null, input1:Texture = null, input2:Texture = null, input3:Texture = null):Texture
Does the actual filter processing.
FragmentFilter
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
 Inherited
render(painter:Painter):void
Renders the filtered target object.
FragmentFilter
Protected Methods
 MethodDefined By
 Inherited
Creates the effect that does the actual, low-level rendering.
FragmentFilter
 Inherited
Called when assigning a target display object.
FragmentFilter
 Inherited
Call this method when any of the filter's properties changes.
FragmentFilter
Events
 Event Summary Defined By
 InheritedDispatched when the settings change in a way that requires a redraw.FragmentFilter
 InheritedDispatched every frame on filters assigned to display objects connected to the stage.FragmentFilter
Property Detail
alphaproperty
alpha:Number

The alpha value of the shadow. Values between 0 and 1 modify the opacity; values > 1 will make it stronger, i.e. produce a harder edge.

The default value is 0.5.


Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void
angleproperty 
angle:Number

The angle with which the shadow is offset, in radians.

The default value is Math.PI / 4.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
blurproperty 
blur:Number

The amount of blur with which the shadow is created. The number of required passes will be Math.ceil(value) × 2.

The default value is 1.0.


Implementation
    public function get blur():Number
    public function set blur(value:Number):void
colorproperty 
color:uint

The color of the shadow.

The default value is 0x0.


Implementation
    public function get color():uint
    public function set color(value:uint):void
distanceproperty 
distance:Number

The offset distance for the shadow, in points.

The default value is 4.0.


Implementation
    public function get distance():Number
    public function set distance(value:Number):void
resolutionproperty 
resolution:Number[override]


Implementation
    public function get resolution():Number
    public function set resolution(value:Number):void
Constructor Detail
DropShadowFilter()Constructor
public function DropShadowFilter(distance:Number = 4.0, angle:Number = 0.785, color:uint = 0x0, alpha:Number = 0.5, blur:Number = 1.0, resolution:Number = 0.5)

Creates a new DropShadowFilter instance with the specified parameters.

Parameters
distance:Number (default = 4.0) — the offset distance of the shadow, in points.
 
angle:Number (default = 0.785) — the angle with which the shadow is offset, in radians.
 
color:uint (default = 0x0) — the color of the shadow.
 
alpha:Number (default = 0.5) — the alpha value of the shadow. Values between 0 and 1 modify the opacity; values > 1 will make it stronger, i.e. produce a harder edge.
 
blur:Number (default = 1.0) — the amount of blur with which the shadow is created. Note that high values will cause the number of render passes to grow.
 
resolution:Number (default = 0.5) — the resolution of the filter texture. '1' means full resolution, '0.5' half resolution, etc.
Method Detail
dispose()method
override public function dispose():void

Disposes all resources that have been created by the filter.