new GeomSpr(game, x, y, type, path [, opt])
Create geometric sprite shapes using Phaser graphics.
Parameters:
Name | Type | Argument | Description | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
game |
Phaser.Game | A Phaser Game instance. |
||||||||||||||||||||||||||||||||||||||||||||||||
x |
Number | x coordinate. |
||||||||||||||||||||||||||||||||||||||||||||||||
y |
Number | y coordinate. |
||||||||||||||||||||||||||||||||||||||||||||||||
type |
string | Type of Shape ('circle', 'rectangle' or 'polygon'). |
||||||||||||||||||||||||||||||||||||||||||||||||
path |
array | Data to draw shapes. For polygon accepts any polygon construction setup. Path will accept any, an array or the Phaser shapes itself. In case of polygon, it also accept all formats available to construct Phaser.Polygon. |
||||||||||||||||||||||||||||||||||||||||||||||||
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 anchor
Phaser.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 point
Phaser.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 destination
Phaser.Sprite | Phaser.Group a destination object
anchor
Phaser.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 ancestor
Phaser.Sprite | Phaser.Group an ancestor of this object
anchor
Phaser.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 tint
Number The tint value to tween to
duration
Number tween duration
options
Object <optional>
{} Tween options
Properties
Name Type Argument Default Description ease
Object <optional>
Phaser.Easing.Default Default Ease function
autostart
Object <optional>
false delay
Object <optional>
0 repeat
Object <optional>
0 yoyo
Object <optional>
false - Inherited From:
-
$$tween(properties, duration [, options])
-
A shortcut for tween creation in sprites
Parameters:
Name Type Argument Default Description properties
Object properties to tween
duration
Number tween duration
options
Object <optional>
{} Tween options
Properties
Name Type Argument Default Description ease
Object <optional>
Phaser.Easing.Default Default Ease function
autostart
Object <optional>
false delay
Object <optional>
0 repeat
Object <optional>
0 yoyo
Object <optional>
false - Inherited From:
- Overrides: