Constructor
new Mask($sprite)
- Description:
- Creates a new mask.
- Source:
Example
const mask = new Mask(sprite);
Parameters:
| Name | Type | Description |
|---|---|---|
$sprite |
Sprite | The sprite. |
Members
sprite :Sprite
- Description:
- Gets the sprite.
- Source:
Gets the sprite.
Type:
translation :Vector2
- Description:
- Gets the position.
- Source:
Gets the position.
Type:
Methods
setSprite($sprite) → {this}
- Description:
- Sets the sprite.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$sprite |
Sprite | The sprite to set. |
Returns:
- Type
- this
translate($vector) → {this}
- Description:
- Translates the mask in the world space from a third person point of view.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$vector |
Vector2 | The translation to apply. |
Returns:
- Type
- this
translateTo($vector) → {this}
- Description:
- Translates the mask in the world space to the given position.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$vector |
Vector2 | The position to translate to. |
Returns:
- Type
- this
translateX($x) → {this}
- Description:
- Translates the mask in the world space from a third person point of view on the x-axis.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$x |
number | The translation to apply on the x-axis. |
Returns:
- Type
- this
translateY($y) → {this}
- Description:
- Translates the mask in the world space from a third person point of view on the y-axis.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$y |
number | The translation to apply on the y-axis. |
Returns:
- Type
- this