Packagestarling.filters
Classpublic class CompositeFilter
InheritanceCompositeFilter Inheritance FragmentFilter Inheritance EventDispatcher Inheritance Object

The CompositeFilter class allows to combine several layers of textures into one texture. It's mainly used as a building block for more complex filters; e.g. the DropShadowFilter uses this class to draw the shadow (the result of a BlurFilter) behind an object.



Public Properties
 PropertyDefined By
 InheritedalwaysDrawToBackBuffer : Boolean
Indicates if the last filter pass is always drawn directly to the back buffer.
FragmentFilter
 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
 Inheritedresolution : Number
The resolution of the filter texture.
FragmentFilter
 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
  
Creates a new instance.
CompositeFilter
 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
 Inherited
dispose():void
Disposes all resources that have been created by the filter.
FragmentFilter
  
getAlphaAt(layerID:int):Number
Indicates the alpha value with which the layer is drawn.
CompositeFilter
  
getColorAt(layerID:int):uint
Returns the RGB color with which a layer is tinted when it is being drawn.
CompositeFilter
  
getOffsetAt(layerID:int, out:Point = null):Point
Returns the position (in points) at which a certain layer will be drawn.
CompositeFilter
 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
  
process(painter:Painter, helper:IFilterHelper, input0:Texture = null, input1:Texture = null, input2:Texture = null, input3:Texture = null):Texture
[override] Combines up to four input textures into one new texture, adhering to the properties of each layer.
CompositeFilter
 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
  
setAlphaAt(layerID:int, alpha:Number):void
Adjusts the alpha value with which the layer is drawn.
CompositeFilter
  
setColorAt(layerID:int, color:uint, replace:Boolean = false):void
Adjusts the RGB color with which a layer is tinted when it is being drawn.
CompositeFilter
  
setOffsetAt(layerID:int, x:Number, y:Number):void
Indicates the position (in points) at which a certain layer will be drawn.
CompositeFilter
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
Constructor Detail
CompositeFilter()Constructor
public function CompositeFilter()

Creates a new instance.

Method Detail
getAlphaAt()method
public function getAlphaAt(layerID:int):Number

Indicates the alpha value with which the layer is drawn.

Parameters

layerID:int

Returns
Number
getColorAt()method 
public function getColorAt(layerID:int):uint

Returns the RGB color with which a layer is tinted when it is being drawn.

Parameters

layerID:int

Returns
uint
getOffsetAt()method 
public function getOffsetAt(layerID:int, out:Point = null):Point

Returns the position (in points) at which a certain layer will be drawn.

Parameters

layerID:int
 
out:Point (default = null)

Returns
Point
process()method 
override public function process(painter:Painter, helper:IFilterHelper, input0:Texture = null, input1:Texture = null, input2:Texture = null, input3:Texture = null):Texture

Combines up to four input textures into one new texture, adhering to the properties of each layer.

Parameters

painter:Painter
 
helper:IFilterHelper
 
input0:Texture (default = null)
 
input1:Texture (default = null)
 
input2:Texture (default = null)
 
input3:Texture (default = null)

Returns
Texture
setAlphaAt()method 
public function setAlphaAt(layerID:int, alpha:Number):void

Adjusts the alpha value with which the layer is drawn.

Parameters

layerID:int
 
alpha:Number

setColorAt()method 
public function setColorAt(layerID:int, color:uint, replace:Boolean = false):void

Adjusts the RGB color with which a layer is tinted when it is being drawn. If replace is enabled, the pixels are not tinted, but instead the RGB channels will replace the texture's color entirely.

Parameters

layerID:int
 
color:uint
 
replace:Boolean (default = false)

setOffsetAt()method 
public function setOffsetAt(layerID:int, x:Number, y:Number):void

Indicates the position (in points) at which a certain layer will be drawn.

Parameters

layerID:int
 
x:Number
 
y:Number