You’re reading the docs for Phaser v3.88.2. The latest is Phaser v4.1.0.

Phaser.GameObjects.Components.Flip

Scope: static

Source: src/gameobjects/components/Flip.js#L7
Since: 3.0.0

Static functions

flipX

flipX: boolean

Description:

The horizontally flipped state of the Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis.

Flipping always takes place from the middle of the texture and does not impact the scale value.

If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Source: src/gameobjects/components/Flip.js#L17
Since: 3.0.0


flipY

flipY: boolean

Description:

The vertically flipped state of the Game Object.

A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)

Flipping always takes place from the middle of the texture and does not impact the scale value.

If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Source: src/gameobjects/components/Flip.js#L31
Since: 3.0.0


Static functions

resetFlip

instanceresetFlip()

Description:

Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L140
Since: 3.0.0


setFlip

instancesetFlip(x, y)

Description:

Sets the horizontal and vertical flipped state of this Game Object.

A Game Object that is flipped will render inversed on the flipped axis.

Flipping always takes place from the middle of the texture and does not impact the scale value.

If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Parameters:

nametypeoptionaldescription
xbooleanNoThe horizontal flipped state. false for no flip, or true to be flipped.
ybooleanNoThe horizontal flipped state. false for no flip, or true to be flipped.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L117
Since: 3.0.0


setFlipX

instancesetFlipX(value)

Description:

Sets the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis.

Flipping always takes place from the middle of the texture and does not impact the scale value.

If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Parameters:

nametypeoptionaldescription
valuebooleanNoThe flipped state. false for no flip, or true to be flipped.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L79
Since: 3.0.0


setFlipY

instancesetFlipY(value)

Description:

Sets the vertical flipped state of this Game Object.

Parameters:

nametypeoptionaldescription
valuebooleanNoThe flipped state. false for no flip, or true to be flipped.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L100
Since: 3.0.0


toggleFlipX

instancetoggleFlipX()

Description:

Toggles the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inversed on the horizontal axis.

Flipping always takes place from the middle of the texture and does not impact the scale value.

If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L45
Since: 3.0.0


toggleFlipY

instancetoggleFlipY()

Description:

Toggles the vertical flipped state of this Game Object.

Returns: Phaser.GameObjects.Components.Flip - This Game Object instance.

Source: src/gameobjects/components/Flip.js#L64
Since: 3.0.0