Circle Radius and Diameter

Demonstrates how to change the size of a geometry Circle by modifying its radius and diameter properties.

Circle Radius and Diameter, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    create ()
    {
        const circle = new Phaser.Geom.Circle(400, 300, 100);

        const graphics = this.add.graphics({ fillStyle: { color: 0xff0000 } });
        graphics.fillCircleShape(circle);

        circle.diameter = circle.radius;

        graphics.fillStyle(0x00ff00);
        graphics.fillCircleShape(circle);

        circle.radius = 10;

        graphics.fillStyle(0x0000ff);
        graphics.fillCircleShape(circle);
    }
}

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);

More in Circle22 examples