new RectangleOverlay(game, x, y, width, height [, opt])
Create a rectangle overlay. Have in mind that only one object can be setted at mask at time
Parameters:
| Name | Type | Argument | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
game |
Phaser.Game | A Phaser Game instance. |
||||||||||||||||||||||||||
x |
Number | x coordinate. |
||||||||||||||||||||||||||
y |
Number | y coordinate. |
||||||||||||||||||||||||||
width |
Number | Area width. |
||||||||||||||||||||||||||
height |
Number | Area height. |
||||||||||||||||||||||||||
opt |
Object |
<optional> |
An optional list of options. Properties
|
Members
-
customMask
-
Manual setting for the mask object
Methods
-
addHighlightCircle(x, y, diameter)
-
Add a circle highlight using a mask
Parameters:
Name Type Description xNumber x coordinate of masking circle.
yNumber y coordinate of masking circle.
diameterNumber Diameter of the masking circle.
-
addHighlightCustom(x, y, mask)
-
Add a custom mask to highligh complex areas
Parameters:
Name Type Description xNumber x coordinate of the mask.
yNumber y coordinate of the mask.
mask* Custom valid object to use as mask (Phaser.Sprite, Phaser.Graphic, etc).
-
addHighlightRect(x, y, width, height)
-
Add a rectangle highlight using a mask
Parameters:
Name Type Description xNumber x coordinate of masking rectangle.
yNumber y coordinate of masking rectangle.
widthNumber Width of masking rectangle.
heightNumber Height of masking rectangle.
-
hide()
-
Make this invisible
-
removeHightlight( [destroyMask])
-
Remove highlight region
Parameters:
Name Type Argument Default Description destroyMaskBoolean <optional>
true To destroy mask after remove highlight or not.
-
show()
-
Make this visible