Stroke Circle

Demonstrates how to draw a circle outline using Graphics lineStyle and the strokeCircle method.

Stroke Circle, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    graphics;

    create ()
    {
        this.graphics = this.add.graphics();

        const color = 0xffff00;
        const thickness = 4;
        const alpha = 1;

        this.graphics.lineStyle(thickness, color, alpha);

        const a = new Phaser.Math.Vector2(400, 300);
        const radius = 128;

        this.graphics.strokeCircle(a.x, a.y, radius);
    }
}

const config = {
    scale: { mode: Phaser.Scale.FIT },
    width: 800,
    height: 600,
    type: Phaser.CANVAS,
    parent: 'game-container',
    scene: Example
};

const game = new Phaser.Game(config);

More in Graphics40 examples