Phaser.Display.Align.In
Scope: static
Source: src/display/align/in/index.js#L7
Static functions
BottomCenter
staticBottomCenter(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that its bottom edge matches the bottom edge of the alignIn Game Object, with its horizontal center aligned to the horizontal center of alignIn.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/BottomCenter.js#L12
Since: 3.0.0
BottomLeft
staticBottomLeft(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that it is positioned in the bottom-left of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/BottomLeft.js#L12
Since: 3.0.0
BottomRight
staticBottomRight(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that it is positioned inside the bottom-right corner of the alignIn Game Object. The right edge of gameObject is matched to the right edge of alignIn, and the bottom edge of gameObject is matched to the bottom edge of alignIn.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/BottomRight.js#L12
Since: 3.0.0
Center
staticCenter(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that it is positioned in the center of the other.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/Center.js#L11
Since: 3.0.0
LeftCenter
staticLeftCenter(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that its left edge is flush with the left edge of the alignIn Game Object, and its vertical center matches the vertical center of alignIn. This places the Game Object at the left-center interior position of the reference object. An optional offset can be applied to adjust the final position along either axis.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/LeftCenter.js#L12
Since: 3.0.0
QuickSet
staticQuickSet(child, alignIn, position, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that it is positioned relative to another Game Object. The alignment used is based on the position argument, which is an ALIGN_CONST value, 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. | |
| alignIn | 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 ALIGN_CONST.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/in/QuickSet.js#L25
Since: 3.0.0
RightCenter
staticRightCenter(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that its right edge is flush with the right edge of the alignIn Game Object, and its vertical center is aligned with the vertical center of the alignIn Game Object.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/RightCenter.js#L12
Since: 3.0.0
TopCenter
staticTopCenter(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that its top edge is flush with the top edge of the alignIn Game Object, centered horizontally.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/TopCenter.js#L12
Since: 3.0.0
TopLeft
staticTopLeft(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes the given Game Object and aligns it so that it is positioned in the top-left of the alignIn Game Object.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/TopLeft.js#L12
Since: 3.0.0
TopRight
staticTopRight(gameObject, alignIn, [offsetX], [offsetY])
Description:
Takes a given Game Object and aligns it so that it is positioned in the top-right of the alignIn Game Object.
Tags:
- generic
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| gameObject | Phaser.GameObjects.GameObject | No | The Game Object that will be positioned. | |
| alignIn | 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/in/TopRight.js#L12
Since: 3.0.0