EaselJS

EaselJS  0.5.0

EaselJS > EaselJS > AlphaMaskFilter
Search:
 
Filters

Class AlphaMaskFilter

Applies the alpha from the mask image (or canvas) to the target, such that the alpha channel of the result will be derived from the mask, and the RGB channels will be copied from the target. This can be used, for example, to apply an alpha mask to a display object. This can also be used to combine a JPG compressed RGB image with a PNG32 alpha mask, which can result in a much smaller file size than a single PNG32 containing ARGB. IMPORTANT NOTE: This filter currently does not support the targetCtx, or targetX/Y parameters correctly.

Constructor

AlphaMaskFilter ( mask )
Parameters:
mask <Image>

Properties

mask - Image

The image (or canvas) to use as the mask.

Methods

applyFilter

void applyFilter ( ctx , x , y , width , height , targetCtx , targetX , targetY )
Applies the filter to the specified context. IMPORTANT NOTE: This filter currently does not support the targetCtx, or targetX/Y parameters correctly.
Parameters:
ctx <object> The 2D context to use as the source.
x <object> The x position to use for the source rect.
y <object> The y position to use for the source rect.
width <object> The width to use for the source rect.
height <object> The height to use for the source rect.
targetCtx <object> Optional. The 2D context to draw the result to. Defaults to the context passed to ctx.
targetX <object> Optional. The x position to draw the result to. Defaults to the value passed to x.
targetY <object> Optional. The y position to draw the result to. Defaults to the value passed to y.
Returns: void

clone

void clone ( )
Returns a clone of this object.
Returns: void

toString

void toString ( )
Returns a string representation of this object.
Returns: void