Set Ellipse Size
Demonstrates how to update the width and height of a geometric ellipse using the setSize method.
800 × 600
class Example extends Phaser.Scene
{
create ()
{
const ellipse = new Phaser.Geom.Ellipse(400, 300);
const graphics = this.add.graphics({ lineStyle: { width: 2, color: 0x00aaaa } });
for (let i = 0; i < 26; i++)
{
ellipse.setSize(i * 32, i * 24);
// stroke with increasing smoothness
graphics.strokeEllipseShape(ellipse, 32 + i);
}
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
width: 800,
height: 600,
type: Phaser.AUTO,
parent: 'game-container',
scene: Example
};
const game = new Phaser.Game(config);