Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Tweens
Phaser 4.1.0
Phaser 4 examples
Tweens
85
examples
2
folders
Folders
2
Chains
5 examples
Eases
22 examples
Examples
58
Card Flip Texture Swap
Demonstrates how to create a card flipping effect by synchronizing a texture change with a scale tween.
Change Texture Frame
Demonstrates how to change a Game Object's texture frame as part of a tween, combined with other property changes like position and scale.
Checkerboard Grid Animation
Aligns a group of sprites into a grid and applies staggered scaling tweens to create a row-based wave animation effect.
Checkerboard Grid Rotation
Demonstrates rotating a grid of sprites using tweens with random delays and dynamic rotation values calculated via getEnd and getStart callbacks.
Counter Tween
Demonstrates how to use a counter tween to interpolate between two numeric values and update a text display, including how to dynamically update the tween target value while it is still playing.
Custom Ease Function
Demonstrates how to provide a custom function to a tween's ease property to create unique motion curves.
Double Tween Comparison
A side-by-side comparison of Phaser's built-in Tween Manager and the GSAP library, demonstrating identical movement using different animation engines.
Dynamic End Property
This example demonstrates how to use functions to define tween target values, allowing the destination of a tween to update dynamically based on the current position of another object.
Dynamic Tween Properties
Demonstrates how to use getter functions to dynamically calculate the start and end values of a tween property during execution.
Elasticity
Demonstrates the use of elastic easing in a tween, including how to pass custom amplitude and period parameters to fine-tune the movement.
Global Tween Time Scale
Demonstrates how to use the Tween Manager's global timeScale property to control the playback speed of all active tweens simultaneously.
Grid Tween with Staggered Column Delays
Arrange a group of sprites into a grid and apply scale tweens with staggered delays based on their column index to create a wave effect.
Grid Tween with Staggered Column Delays
Aligns a group of blocks into a grid and applies complex tweens with delays that reset at the end of every row, creating a synchronized column animation.
Interpolation Methods for Array Values
Demonstrates how to use an array of values for a tween property and apply different interpolation algorithms like Bezier and Catmull-Rom.
Linear and Bounce Tween
Demonstrates applying different easing functions, durations, and yoyo behaviors to the X and Y properties of a single sprite within one tween.
Loop Delay
Demonstrates how to add a delay between each iteration of a looping tween.
Multiple Delayed Properties
Apply different durations, easing functions, and delays to multiple properties within a single tween, including the use of functional delays.
Multiple Dynamic Tween Properties
Demonstrates using dynamic functions for property values within a single tween to calculate start and end positions at runtime.
Multiple Properties
This example demonstrates how to tween multiple properties of a single target simultaneously, with independent durations and easing functions for each property.
Multiple Properties Loop
Demonstrates how to animate multiple properties of a target simultaneously using different durations and easing functions, while looping the entire animation.
Multiple Properties with Individual Yoyo
Demonstrates how to apply independent durations, easing functions, and yoyo effects to multiple properties within a single tween.
Multiple Targets
Demonstrates how to apply a single tween to an array of multiple game objects simultaneously.
Multiple Targets and Multiple Properties
This example shows how to tween multiple Game Objects simultaneously, with separate durations and easing functions for different properties like x and y.
Number Counter Tween
Demonstrates how to use addCounter to interpolate between two numeric values. This type of tween doesn't require a target object property and allows you to retrieve the current value, progress, and elapsed time manually.
Number Counter Tween with Yoyo
Demonstrates how to use a counter tween to interpolate between two numeric values with a yoyo effect, accessing the current value and progress manually.
On Complete Callback
Demonstrates how to use the onComplete callback and onCompleteParams to execute a function and pass custom data once a tween has finished.
Pause and Resume a Tween
Demonstrates how to toggle a tween's playback state between paused and playing using pointer input.
Pause and Resume All Tweens
Demonstrates how to pause and resume every active tween in a scene simultaneously using the Tween Manager's global control methods.
Paused Tween
Demonstrates how to create a tween in a paused state and trigger its playback later using the play method.
Relative Value Tween with Repeating
Demonstrates how to use relative string values like '-=64' to animate a property based on its current position, combined with yoyo and repeat settings.
Relative Value Tweens
Demonstrates how to use string operators like += and -= to create tweens relative to an object's current property values.
Remove Tween
Demonstrates how to manually stop and remove an active tween from the Tween Manager using the tween's remove method.
Seek To Point In Tween
This example demonstrates how to use the seek method to jump to a specific millisecond position within a running tween.
Stagger Delay
Apply a staggered delay to a group of targets in a single tween, causing them to start their animation sequence at different intervals.
Staggered Column Tweens
Demonstrates applying staggered scale and rotation animations to a grid of sprites using column-based delay calculations.
Stop a Tween
Demonstrates how to manually stop a running tween using the stop method, triggered by a pointer event.
Tween Behavior with CPU Lag
Demonstrates how the tween system handles a significant main-thread block (CPU lag) while managing thousands of concurrent sprite tweens.
Tween Callbacks
Demonstrates how to use lifecycle event callbacks in a tween, including onStart, onComplete, onYoyo, onRepeat, onPause, and onResume.
Tween Circle Radius
Animates a group of sprites by tweening the radius of a geometric circle and updating their positions using the onUpdate callback.
Tween Complete Delay
This example demonstrates how to use the completeDelay property to pause for a set duration after a tween finishes its movement before triggering the completion event.
Tween Delay
Demonstrates how to use the delay property to postpone the start of a tween for a specific duration.
Tween Delay Function
Demonstrates how to use a callback function to dynamically calculate the delay of a tween, allowing for randomized or logic-based start times.
Tween Flip X
Use the flipX property in a tween to automatically flip an image horizontally when it yoyos or repeats.
Tween Flip Y
Demonstrates how to use the flipY property in a tween to automatically flip an image vertically when it yoyos or repeats.
Tween From and To Values
This example shows how to explicitly define the starting and ending values of a property within a tween configuration.
Tween Gauge Animation
Simulate a dial or gauge by tweening the rotation of a needle sprite using relative values, yoyo effects, and custom origins.
Tween Lag Recovery
Demonstrates how the Phaser Tween Manager handles a sudden CPU block or lag spike during an active animation, showing how the tween positions synchronize once the thread is released.
Tween Lag Smoothing
Demonstrates how the tween system handles and recovers from significant CPU lag by simulating a long blocking process during tween playback.
Tween Loop
Demonstrates how to repeat a tween multiple times using the loop property and how to use the onLoop callback to track the current loop count.
Tween Manager Garbage Collection Performance
A stress test creating thousands of single-use tweens to demonstrate how the Tween Manager efficiently handles high volume and internal garbage collection.
Tween On Start Callback
Demonstrates how to use the onStart event and onStartParams to execute a function and pass custom data when a tween begins playing.
Tween On Yoyo Callback
Demonstrates how to use the onYoyo callback to trigger logic specifically when a tween finishes its forward motion and begins to reverse direction.
Tween Performance Stress Test
A performance test demonstrating the engine handling thousands of tweening Blitter objects simultaneously, adding 256 new items per frame while the pointer is held down.
Tween Sprite Angle
Animate the rotation of a sprite between two specific angles using a repeating yoyo tween.
Tween Sprite Angle
Demonstrates how to rotate a sprite indefinitely by tweening its angle property with a relative value.
Tween Stagger Showcase
A demonstration of the different configurations available for stagger tweens, showcasing how to apply delays across a grid using various start points, ranges, and easing functions.
Tween Text Size and Color
Demonstrates how to use a Tween Counter to animate the font size and color of a Text object via the onUpdate callback.
Tween Texture Change
Demonstrates how to swap the texture of an image using a repeating tween and trigger particle effects during the swap using the onRepeat callback.