phaser - v3.90.0
    Preparing search index...

    The Pixelate FX Controller.

    This FX controller manages the pixelate effect for a Game Object.

    The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as during a transition or to censor specific content.

    A Pixelate effect is added to a Game Object via the FX component:

    const sprite = this.add.sprite();

    sprite.preFX.addPixelate();
    sprite.postFX.addPixelate();

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • gameObject: GameObject

        A reference to the Game Object that has this fx.

      • Optionalamount: number

        The amount of pixelation to apply. Default 1.

      Returns Pixelate

    Properties

    active: boolean

    Toggle this boolean to enable or disable this effect, without removing and adding it from the Game Object.

    Only works for Pre FX.

    Post FX are always active.

    amount: number

    The amount of pixelation to apply.

    gameObject: GameObject

    A reference to the Game Object that owns this effect.

    type: number

    The FX_CONST type of this effect.

    Methods

    • Destroys this FX Controller.

      Returns void

    • Sets the active state of this FX Controller.

      A disabled FX Controller will not be updated.

      Parameters

      • value: boolean

        true to enable this FX Controller, or false to disable it.

      Returns this