Phaser.Display.Align.To
Scope: static
Source: src/display/align/to/index.js#L7
Static functions
BottomCenter
staticBottomCenter(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/BottomCenter.js#L12
Since: 3.0.0
BottomLeft
staticBottomLeft(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/BottomLeft.js#L12
Since: 3.0.0
BottomRight
staticBottomRight(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/BottomRight.js#L12
Since: 3.0.0
LeftBottom
staticLeftBottom(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/LeftBottom.js#L12
Since: 3.0.0
LeftCenter
staticLeftCenter(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the left center position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/LeftCenter.js#L12
Since: 3.0.0
LeftTop
staticLeftTop(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the left top position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/LeftTop.js#L12
Since: 3.0.0
QuickSet
staticQuickSet(child, alignTo, position, [offsetX], [offsetY])
Description:
Takes a Game Object and aligns it next to another, at the given position.
The alignment used is based on the position argument, which is a Phaser.Display.Align property such as LEFT_CENTER or TOP_RIGHT.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| child | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| position | number | No | The position to align the Game Object with. This is an align constant, such as Phaser.Display.Align.LEFT_CENTER. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/QuickSet.js#L24
Since: 3.22.0
RightBottom
staticRightBottom(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/RightBottom.js#L12
Since: 3.0.0
RightCenter
staticRightCenter(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the right center position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/RightCenter.js#L12
Since: 3.0.0
RightTop
staticRightTop(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the right top position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/RightTop.js#L12
Since: 3.0.0
TopCenter
staticTopCenter(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the top center position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/TopCenter.js#L12
Since: 3.0.0
TopLeft
staticTopLeft(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the top left position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/TopLeft.js#L12
Since: 3.0.0
TopRight
staticTopRight(gameObject, alignTo, [offsetX], [offsetY])
Description:
Takes given Game Object and aligns it so that it is positioned next to the top right position of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignTo | Phaser.GameObjects.GameObject | No | The Game Object to base the alignment position on. | |
| offsetX | number | Yes | 0 | Optional horizontal offset from the position. |
| offsetY | number | Yes | 0 | Optional vertical offset from the position. |
Returns: Phaser.GameObjects.GameObject - The Game Object that was aligned.
Source: src/display/align/to/TopRight.js#L12
Since: 3.0.0