Wipe Bottom To Top Filter
Demonstrates how to apply a wipe transition effect to a sprite, revealing it from the bottom upwards by tweening the filter's progress property.
800 × 600
class Example extends Phaser.Scene
{
constructor ()
{
super();
}
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('pyramid', 'assets/sprites/pyramid.png');
this.load.image('bg', 'assets/skies/space4.png');
}
create ()
{
this.add.image(400, 300, 'bg');
const sprite = this.add.image(400, 300, 'pyramid');
const fx = sprite.enableFilters().filters.internal.addWipe().setBottomToTop();
this.tweens.add({
targets: fx,
progress: 1,
repeatDelay: 1000,
hold: 1000,
yoyo: true,
repeat: -1,
duration: 2000
});
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.AUTO,
width: 800,
height: 600,
backgroundColor: '#0a0067',
parent: 'game-container',
scene: Example
};
let game = new Phaser.Game(config);
More in Wipe12 examples
Wipe Filter to PointerUse a Wipe filter on a sprite and link its progress to the mouse pointer position to create an interactive transition effect between two images.
Wipe Left To Right FilterDemonstrates how to apply and animate a wipe filter effect on a sprite from left to right using a tween.
Wipe Right To LeftDemonstrates how to apply a wipe filter to a sprite to reveal or hide it from right to left using a tween to control the effect's progress.
Wipe Scene TransitionDemonstrates how to transition between scenes using a camera wipe filter by syncing the filter progress with the Scene Transition update callback.