# Class: AlphaMask

**`Advanced`**

AlphaMask is an effect that applies a mask to a container using a sprite texture.
By default, the red channel of the mask texture controls visibility. Set `channel` to `'alpha'`
to use the alpha channel instead, which is useful for masks defined by transparency.
The mask can be inverted, and non-sprite masks are rendered to a texture automatically.

## Implements

- [`Effect`](rendering.Effect.html.md)
- [`PoolItem`](utils.PoolItem.html.md)

## Constructors

### Constructor

> **new AlphaMask**(`options?`): `AlphaMask`

#### Parameters

##### options?

###### mask

[`Container`](scene.Container.html.md)

#### Returns

`AlphaMask`

## Properties

### channel

> **channel**: [`MaskChannel`](rendering.MaskChannel.html.md) = `'red'`

***

### inverse

> **inverse**: `boolean` = `false`

***

### mask

> **mask**: [`Container`](scene.Container.html.md)

***

### pipe

> **pipe**: `string` = `'alphaMask'`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`pipe`](rendering.Effect.html#pipe)

***

### priority

> **priority**: `number` = `0`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`priority`](rendering.Effect.html#priority)

***

### renderMaskToTexture

> **renderMaskToTexture**: `boolean`

***

### extension

> `static` **extension**: [`ExtensionMetadata`](extensions.ExtensionMetadata.html.md) = `ExtensionType.MaskEffect`

## Methods

### addBounds()

> **addBounds**(`bounds`, `skipUpdateTransform?`): `void`

#### Parameters

##### bounds

[`Bounds`](rendering.Bounds.html.md)

##### skipUpdateTransform?

`boolean`

#### Returns

`void`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`addBounds`](rendering.Effect.html#addbounds)

***

### addLocalBounds()

> **addLocalBounds**(`bounds`, `localRoot`): `void`

#### Parameters

##### bounds

[`Bounds`](rendering.Bounds.html.md)

##### localRoot

[`Container`](scene.Container.html.md)

#### Returns

`void`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`addLocalBounds`](rendering.Effect.html#addlocalbounds)

***

### containsPoint()

> **containsPoint**(`point`, `hitTestFn`): `boolean`

#### Parameters

##### point

[`Point`](maths.Point.html.md)

##### hitTestFn

(`container`, `point`) => `boolean`

#### Returns

`boolean`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`containsPoint`](rendering.Effect.html#containspoint)

***

### destroy()

> **destroy**(): `void`

#### Returns

`void`

#### Implementation of

[`Effect`](rendering.Effect.html.md).[`destroy`](rendering.Effect.html#destroy)

***

### init()

> **init**(`mask`): `void`

#### Parameters

##### mask

[`Container`](scene.Container.html.md)

#### Returns

`void`

#### Implementation of

`PoolItem.init`

***

### reset()

> **reset**(): `void`

#### Returns

`void`

#### Implementation of

`PoolItem.reset`

***

### test()

> `static` **test**(`mask`): `boolean`

#### Parameters

##### mask

`any`

#### Returns

`boolean`
