new OverlaySpr(game, x, y, width, height, path [, opt])
Create a sprite as overlay with an (optional) simple form hole.
Parameters:
| Name | Type | Argument | Default | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
game |
Phaser.Game | A Phaser Game instance. |
||||||||||||||||||||||
x |
Number | x coordinate of the outer overlay's border. |
||||||||||||||||||||||
y |
Number | y coordinate of the outer overlay's border. |
||||||||||||||||||||||
width |
Number | Width of the outer overlay's border. |
||||||||||||||||||||||
height |
Number | Height of the outer overlay's border. |
||||||||||||||||||||||
path |
array | false | Path to draw the hole. Hole should be an instance of any: Rectangle.Phaser, Circle.Phaser, Polygon.Phaser or none (if no hole is needed). Cordinates will be specified with absolute values (not relatives to overlay itself). |
|||||||||||||||||||||
opt |
Object |
<optional> |
An optional list of options. Properties
|
Extends
Methods
-
$$centered( [anchor])
-
A shortcut for placing a sprite in the center of the screen
Parameters:
Name Type Argument Default Description anchorPhaser.Point <optional>
new Phaser.Point(0.5, 0.5) the anchor point
- Inherited From:
-
$$contains(point)
-
Checks if the sprites contains a point
Parameters:
Name Type Description pointPhaser.Point the anchor point
- Inherited From:
-
$$moveTo(destination [, anchor])
-
Moves the current object in the coordinates of another, considering groups/scaling
Parameters:
Name Type Argument Default Description destinationPhaser.Sprite | Phaser.Group a destination object
anchorPhaser.Point <optional>
new Phaser.Point(0.5, 0.5) the anchor point
- Inherited From:
-
$$pointIn(ancestor [, anchor])
-
Gets the cooordinates of the current object based on one of its ancestors
Parameters:
Name Type Argument Default Description ancestorPhaser.Sprite | Phaser.Group an ancestor of this object
anchorPhaser.Point <optional>
new Phaser.Point(0.5, 0.5) the anchor point
- Inherited From:
-
$$tintTween(tint, duration [, options])
-
A shortcut for tint tween
Parameters:
Name Type Argument Default Description tintNumber The tint value to tween to
durationNumber tween duration
optionsObject <optional>
{} Tween options
Properties
Name Type Argument Default Description easeObject <optional>
Phaser.Easing.Default Default Ease function
autostartObject <optional>
false delayObject <optional>
0 repeatObject <optional>
0 yoyoObject <optional>
false - Inherited From:
-
$$tween(properties, duration [, options])
-
A shortcut for tween creation in sprites
Parameters:
Name Type Argument Default Description propertiesObject properties to tween
durationNumber tween duration
optionsObject <optional>
{} Tween options
Properties
Name Type Argument Default Description easeObject <optional>
Phaser.Easing.Default Default Ease function
autostartObject <optional>
false delayObject <optional>
0 repeatObject <optional>
0 yoyoObject <optional>
false - Inherited From:
- Overrides: