- Source: src/display/align/to/index.js (Line 7)
Methods
-
<static> BottomCenter(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/BottomCenter.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> BottomLeft(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/BottomLeft.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> BottomRight(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/BottomRight.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> LeftBottom(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/LeftBottom.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> LeftCenter(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the left center position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/LeftCenter.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> LeftTop(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the left top position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/LeftTop.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> QuickSet(child, alignTo, position [, offsetX] [, offsetY])
-
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 aPhaser.Display.Align
property such asLEFT_CENTER
orTOP_RIGHT
.Parameters:
Name Type Argument Default Description child
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
position
number The position to align the Game Object with. This is an align constant, such as
Phaser.Display.Align.LEFT_CENTER
.offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.22.0
- Source: src/display/align/to/QuickSet.js (Line 24)
Returns:
The Game Object that was aligned.
-
<static> RightBottom(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/RightBottom.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> RightCenter(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the right center position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/RightCenter.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> RightTop(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the right top position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/RightTop.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> TopCenter(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the top center position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/TopCenter.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> TopLeft(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the top left position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/TopLeft.js (Line 12)
Returns:
The Game Object that was aligned.
-
<static> TopRight(gameObject, alignTo [, offsetX] [, offsetY])
-
Takes given Game Object and aligns it so that it is positioned next to the top right position of the other.
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject The Game Object that will be positioned.
alignTo
Phaser.GameObjects.GameObject The Game Object to base the alignment position on.
offsetX
number <optional>
0 Optional horizontal offset from the position.
offsetY
number <optional>
0 Optional vertical offset from the position.
- Since: 3.0.0
- Source: src/display/align/to/TopRight.js (Line 12)
Returns:
The Game Object that was aligned.