Skip to main content
Version: Phaser v4.0.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 inverted 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#L20
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 inverted 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#L34
Since: 3.0.0


Static functions

resetFlip

<instance> resetFlip()

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#L151
Since: 3.0.0


setFlip

<instance> setFlip(x, y)

Description:

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

A Game Object that is flipped will render inverted 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 vertical 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#L128
Since: 3.0.0


setFlipX

<instance> setFlipX(value)

Description:

Sets the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inverted 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#L86
Since: 3.0.0


setFlipY

<instance> setFlipY(value)

Description:

Sets the vertical flipped state of this Game Object.

A Game Object that is flipped vertically will render inverted on the vertical 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#L107
Since: 3.0.0


toggleFlipX

<instance> toggleFlipX()

Description:

Toggles the horizontal flipped state of this Game Object.

A Game Object that is flipped horizontally will render inverted 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#L48
Since: 3.0.0


toggleFlipY

<instance> toggleFlipY()

Description:

Toggles the vertical flipped state of this Game Object.

A Game Object that is flipped vertically will render inverted on the vertical 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#L67
Since: 3.0.0