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 x
Number x coordinate of masking circle.
y
Number y coordinate of masking circle.
diameter
Number Diameter of the masking circle.
-
addHighlightCustom(x, y, mask)
-
Add a custom mask to highligh complex areas
Parameters:
Name Type Description x
Number x coordinate of the mask.
y
Number 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 x
Number x coordinate of masking rectangle.
y
Number y coordinate of masking rectangle.
width
Number Width of masking rectangle.
height
Number Height of masking rectangle.
-
hide()
-
Make this invisible
-
removeHightlight( [destroyMask])
-
Remove highlight region
Parameters:
Name Type Argument Default Description destroyMask
Boolean <optional>
true To destroy mask after remove highlight or not.
-
show()
-
Make this visible