Creates a new DropShadowFilter instance with the specified parameters.
the offset distance of the shadow, in points.
the angle with which the shadow is offset, in radians.
the color of the shadow.
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 amount of blur with which the shadow is created. Note that high values will cause the number of render passes to grow.
the quality of the shadow blur, '1' being the best (range 0.1 - 1.0)
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. @default 0.5
Indicates if the last filter pass is always drawn directly to the back buffer.
Per default, the filter tries to automatically render in a smart way: objects that are currently moving are rendered to the back buffer, objects that are static are rendered into a texture first, which allows the filter to be drawn directly from the render cache in the next frame (in case the object remains static).
However, this fails when filters are added to an object that does not support the render cache, or to a container with such a child (e.g. a Sprite3D object or a masked display object). In such a case, enable this property for maximum performance.
@default false
The angle with which the shadow is offset, in radians. @default Math.PI / 4
The anti-aliasing level. This is only used for rendering the target object into a texture, not for the filter passes. 0 - none, 4 - maximum. @default 0
The amount of blur with which the shadow is created.
The number of required passes will be Math.ceil(value) × 2
.
@default 1.0
The color of the shadow. @default 0x0
The offset distance for the shadow, in points. @default 4.0
Indicates if the filter is cached (via the cache
method).
Indicates if the filter requires all passes to be processed with the exact same resolution.
Some filters must use the same resolution for input and output; e.g. the blur filter
is very sensitive to changes of pixel / texel sizes. When the filter is used as part
of a filter chain, or if its last pass is drawn directly to the back buffer, such a
filter produces artifacts. In that case, the filter author must set this property
to true
.
@default false
Padding can extend the size of the filter texture in all directions. That's useful when the filter "grows" the bounds of the object in any direction.
The quality used for blurring the shadow. Forwarded to the internally used BlurFilter.
The resolution of the filter texture. "1" means stage resolution, "0.5" half the stage resolution. A lower resolution saves memory and execution time, but results in a lower output quality. Values greater than 1 are allowed; such values might make sense for a cached filter when it is scaled up. @default 1
The format of the filter texture. @default BGRA
The smoothing mode of the filter texture. @default bilinear
Caches the filter output into a texture.
An uncached filter is rendered every frame (except if it can be rendered from the
global render cache, which happens if the target object does not change its appearance
or location relative to the stage). A cached filter is only rendered once; the output
stays unchanged until you call cache
again or change the filter settings.
Beware: you cannot cache filters on 3D objects; if the object the filter is attached to is a Sprite3D or has a Sprite3D as (grand-) parent, the request will be silently ignored. However, you can cache a 2D object that has 3D children!
Clears the cached output of the filter. After calling this method, the filter will be processed once per frame again.
Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.
Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.
If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.
Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.
Renders the filtered target object. Most users will never have to call this manually; it's executed automatically in the rendering process of the filtered display object.
Generated using TypeDoc
The DropShadowFilter class lets you add a drop shadow to display objects. To create the shadow, the class internally uses the BlurFilter.