Positions the Game Object so that it is centered on the given coordinates.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
x | number |
The horizontal coordinate to position the Game Object on. |
y | number |
The vertical coordinate to position the Game Object on. |
The Game Object that was positioned.
Returns the bottom coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The bottom coordinate of the bounds of the Game Object.
Returns the unrotated bounds of the Game Object as a rectangle.
name | type | arguments | description |
---|---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
|
output | object | Phaser.Geom.Rectangle | <optional> |
An object to store the values in. If not provided a new Rectangle will be created. |
Returns the center x coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The center x coordinate of the bounds of the Game Object.
Returns the center y coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The center y coordinate of the bounds of the Game Object.
Returns the left coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The left coordinate of the bounds of the Game Object.
Returns the amount the Game Object is visually offset from its x coordinate.
This is the same as width * origin.x
.
This value will only be > 0 if origin.x
is not equal to zero.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The horizontal offset of the Game Object.
Returns the amount the Game Object is visually offset from its y coordinate.
This is the same as width * origin.y
.
This value will only be > 0 if origin.y
is not equal to zero.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The vertical offset of the Game Object.
Returns the right coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The right coordinate of the bounds of the Game Object.
Returns the top coordinate from the bounds of the Game Object.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object to get the bounds value from. |
The top coordinate of the bounds of the Game Object.
Positions the Game Object so that the bottom of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
value | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.
Positions the Game Object so that the center top of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
x | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.
Positions the Game Object so that the center top of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
y | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.
Positions the Game Object so that the left of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
value | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.
Positions the Game Object so that the left of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
value | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.
Positions the Game Object so that the top of its bounds aligns with the given coordinate.
name | type | description |
---|---|---|
gameObject | Phaser.GameObjects.GameObject |
The Game Object that will be re-positioned. |
value | number |
The coordinate to position the Game Object bounds on. |
The Game Object that was positioned.