phaser - v4.0.0-rc.4
    Preparing search index...

    Provides methods used for visually flipping a Game Object. Should be applied as a mixin and not used directly.

    interface Flip {
        flipX: boolean;
        flipY: boolean;
        resetFlip(): this;
        setFlip(x: boolean, y: boolean): this;
        setFlipX(value: boolean): this;
        setFlipY(value: boolean): this;
        toggleFlipX(): this;
        toggleFlipY(): this;
    }

    Implemented by

    Index

    Properties

    flipX: boolean

    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.

    flipY: boolean

    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.

    Methods

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

      Returns this

    • 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

      • x: boolean

        The horizontal flipped state. false for no flip, or true to be flipped.

      • y: boolean

        The horizontal flipped state. false for no flip, or true to be flipped.

      Returns this

    • 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

      • value: boolean

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

      Returns this

    • Sets the vertical flipped state of this Game Object.

      Parameters

      • value: boolean

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

      Returns this

    • 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 this

    • Toggles the vertical flipped state of this Game Object.

      Returns this