PokéRogue
    Preparing search index...

    The Wipe Filter Controller.

    This controller manages the wipe effect for a Camera.

    The wipe or reveal effect is a visual technique that gradually uncovers or conceals elements in the game, such as images, text, or scene transitions. This effect is often used to create a sense of progression, reveal hidden content, or provide a smooth and visually appealing transition between game states.

    You can set both the direction and the axis of the wipe effect. The following combinations are possible:

    • left to right: direction 0, axis 0
    • right to left: direction 1, axis 0
    • top to bottom: direction 1, axis 1
    • bottom to top: direction 0, axis 1

    It is up to you to set the progress value yourself, e.g. via a Tween, in order to transition the effect.

    A Wipe effect is added to a Camera via the FilterList component:

    const camera = this.cameras.main;
    camera.filters.internal.addWipe();
    camera.filters.external.addWipe();

    Hierarchy (View Summary)

    Index
    • Parameters

      • camera: Camera

        The camera that owns this filter.

      • OptionalwipeWidth: number

        The width of the wipe effect. This value is normalized in the range 0 to 1. Default 0.1.

      • Optionaldirection: number

        The direction of the wipe effect. Either 0 (left to right, or top to bottom) or 1 (right to left, or bottom to top). Set in conjunction with the axis property. Default 0.

      • Optionalaxis: number

        The axis of the wipe effect. Either 0 (X) or 1 (Y). Set in conjunction with the direction property. Default 0.

      • Optionalreveal: number

        Is this a reveal (1) or a wipe (0) effect? Reveal shows the input in wiped areas; wipe shows the input in unwiped areas. Default 0.

      • OptionalwipeTexture: string | Texture

        Texture or texture key to use where the input texture is not shown. The default texture is blank. Use another texture for a wipe transition. Default '__DEFAULT'.

      Returns Wipe

    active: boolean

    Toggle this boolean to enable or disable this filter, without removing it from and re-adding it to the Camera's filter list.

    allowBaseDraw: boolean

    If true, this filter will be permitted to draw to the base texture. This can be unwanted if, for example, the filter doesn't actually draw anything.

    This is an internal flag used by the renderer. You should not modify this value directly.

    axis: number

    The axis of the wipe effect. Either 0 (X) or 1 (Y). Set in conjunction with the direction property.

    camera: Camera

    A reference to the Camera that owns this filter.

    currentPadding: Rectangle

    The padding currently being used by this filter. This is read during rendering via getPadding, and may be updated by subclass implementations. It is necessary for filters being used in an external list. You should not modify this value directly.

    direction: number

    The direction of the wipe effect. Either 0 (left to right, or top to bottom) or 1 (right to left, or bottom to top). Set in conjunction with the axis property.

    ignoreDestroy: boolean

    Whether this filter controller will be destroyed when the FilterList that owns it is destroyed. If you enable this, you must ensure that you clean up the filter controller at an appropriate time. This allows you to reuse a controller for multiple objects; this is not recommended unless you know what you're doing. It tends to work best with external filters.

    paddingOverride: Rectangle

    Padding override. This is on by default. If this is set, the filter will use this padding instead of calculating it. Prefer using setPaddingOverride instead of modifying this directly.

    progress: number

    The progress of the Wipe effect. This value is normalized to the range 0 to 1.

    Adjust this value to make the wipe transition (e.g. via a Tween).

    renderNode: string

    The ID of the RenderNode that this filter uses.

    reveal: number

    Is this a reveal (1) or a wipe (0) effect? Reveal shows the input in wiped areas; wipe shows the input in unwiped areas.

    wipeTexture: Texture

    The texture to use where the input is removed. The default texture '__DEFAULT' is blank. Use another texture for a wipe transition.

    wipeWidth: number

    The width of the wipe effect. This value is normalized in the range 0 to 1.

    • Destroys this Controller and nulls any references it holds.

      Returns void

    • Returns the raw padding required for this filter. This is typically not what you want to call; use getPaddingCeil instead. Values from this method are not rounded, which can cause quality loss.

      Override this method when creating a Filter that requires extra room, e.g. a blur or glow effect.undefined

      Returns Rectangle

      The padding required by this filter.

    • Returns the rounded padding required for this filter.

      Most filters don't need extra padding, but some may sample beyond the texture boundaries, such as a blur or glow effect.

      The bounds are encoded as a Rectangle. To enlarge the bounds, the top and left values should be negative, and the bottom and right values should be positive.

      This method calls getPadding() to get the raw padding values, and uses Math.ceil() to set the values of paddingOverride and currentPadding.undefined

      Returns Rectangle

      The rounded padding required by this filter.

    • Sets the active state of this filter.

      A disabled filter will not be used.

      Parameters

      • value: boolean

        true to enable this filter, or false to disable it.

      Returns this

      This filter instance.

    • Set the wipe effect to run bottom to top.undefined

      Returns this

      • This filter instance.
    • Set the wipe effect to run left to right.undefined

      Returns this

      • This filter instance.
    • Sets the padding override. If this is set, the filter will use this padding instead of calculating it. Call setPaddingOverride(null) to clear the override. Call setPaddingOverride() to set the padding to 0.

      Parameters

      • Optionalleft: number | null

        The left padding. Default 0.

      • Optionaltop: number

        The top padding. Default 0.

      • Optionalright: number

        The right padding. Default 0.

      • Optionalbottom: number

        The bottom padding. Default 0.

      Returns void

    • Sets the progress of the wipe effect, controlling how far along the transition has advanced. A value of 0 means the transition has not started, and 1 means it is complete. You would typically drive this via a Tween rather than setting it directly.

      Parameters

      • value: number

        Progress, normalized to the range 0-1.

      Returns this

      • This filter instance.
    • Configures this filter to run as a reveal effect, where the input is gradually uncovered as the transition progresses. Also resets the texture to the default blank texture and resets progress to 0. Use setWipeEffect for the opposite behavior.undefined

      Returns this

      • This filter instance.
    • Set the wipe effect to run right to left.undefined

      Returns this

      • This filter instance.
    • Set the texture to use where the input is removed. The default texture is blank, so the input is just hidden.

      Parameters

      • Optionaltexture: string | Texture

        Texture or texture key to use for regions where the input is removed. Default '__DEFAULT'.

      Returns this

      • This filter instance.
    • Set the wipe effect to run top to bottom.undefined

      Returns this

      • This filter instance.
    • Configures this filter to run as a wipe effect, where the input is removed as the transition progresses. Also resets progress to 0. Use setRevealEffect for the opposite behavior.undefined

      Returns this

      • This filter instance.
    • Set the width of the wipe effect.

      Parameters

      • width: number

        The width of the wipe effect. This value is normalized in the range 0 to 1.

      Returns this

      • This filter instance.