Class: RectangleOverlay

RectangleOverlay


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
Name Type Argument Default Description
aX Number <optional>
0.5

Anchor in x axis (0.5 by default).

aY Number <optional>
0.5

Anchor in y axis (0.5 by default).

alpha Number <optional>
0.5

Overlay's alpha value.

parent * <optional>

Assign a parent if you setted it in this property.

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