Package | starling.filters |
Class | public class BlurFilter |
Inheritance | BlurFilter FragmentFilter EventDispatcher Object |
Property | Defined By | ||
---|---|---|---|
alwaysDrawToBackBuffer : Boolean Indicates if the last filter pass is always drawn directly to the back buffer. | FragmentFilter | ||
antiAliasing : int The anti-aliasing level. | FragmentFilter | ||
blurX : Number The blur factor in x-direction. | BlurFilter | ||
blurY : Number The blur factor in y-direction. | BlurFilter | ||
isCached : Boolean [read-only] Indicates if the filter is cached (via the cache method). | FragmentFilter | ||
numPasses : int [read-only] Indicates the number of rendering passes required for this filter. | FragmentFilter | ||
padding : Padding Padding can extend the size of the filter texture in all directions. | FragmentFilter | ||
quality : Number The quality of the blur effect. | BlurFilter | ||
resolution : Number The resolution of the filter texture. | FragmentFilter | ||
textureFormat : String The format of the filter texture. | FragmentFilter | ||
textureSmoothing : String The smoothing mode of the filter texture. | FragmentFilter |
Method | Defined By | ||
---|---|---|---|
BlurFilter(blurX:Number = 1.0, blurY:Number = 1.0, resolution:Number = 1.0) Create a new BlurFilter. | BlurFilter | ||
addEventListener(type:String, listener:Function):void Registers an event listener at a certain object. | EventDispatcher | ||
cache():void Caches the filter output into a texture. | FragmentFilter | ||
clearCache():void Clears the cached output of the filter. | FragmentFilter | ||
dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | ||
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 Disposes all resources that have been created by the filter. | FragmentFilter | ||
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 Does the actual filter processing. | FragmentFilter | ||
removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | ||
removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher | ||
Renders the filtered target object. | FragmentFilter |
blurX | property |
blurX:Number
The blur factor in x-direction.
public function get blurX():Number
public function set blurX(value:Number):void
blurY | property |
blurY:Number
The blur factor in y-direction.
public function get blurY():Number
public function set blurY(value:Number):void
quality | property |
quality:Number
The quality of the blur effect. Low values will look as if the target was drawn multiple times in close proximity (range: 0.1 - 1).
Typically, it's better to reduce the filter resolution instead; however, if that is not an option (e.g. when using the BlurFilter as part of a composite filter), this property may provide an alternative.
The default value is 1.0
.
public function get quality():Number
public function set quality(value:Number):void
BlurFilter | () | Constructor |
public function BlurFilter(blurX:Number = 1.0, blurY:Number = 1.0, resolution:Number = 1.0)
Create a new BlurFilter.
The blur is rendered for each direction (x and y) separately; the number of
draw calls add up. The blur value itself is internally multiplied with the current
contentScaleFactor
in order to guarantee a consistent look on HiDPI
displays (dubbed 'totalBlur' below).
The number of draw calls per blur value is the following:
blurX:Number (default = 1.0 )
| |
blurY:Number (default = 1.0 )
| |
resolution:Number (default = 1.0 )
|