Skip to content

GameObject.Line.setLineWidth() works different between Canvas and WebGL render #6604

@AlvaroNeuronup

Description

@AlvaroNeuronup

Version

  • Phaser Version: 3.60.0

  • Operating system: Windows, Android

  • Browser: Chrome, Firefox, Edge

Description

When i set the configuration to Canvas renderer the lines have its size changed. It looks like the width of the lines is half.
I think the expected behaviour is both renders to work the same.

Example Test Code

class Example extends Phaser.Scene
{

    create ()
    {
        const line = this.add.line(100, 100, 200, 300, 500, 200, 0xff0000);
        line.setLineWidth(40);
    }
       
}

const config = {
    type: Phaser.CANVAS, //Phaser.WEBGL
    width: 800,
    height: 600,
    backgroundColor: '#2d2d2d',
    parent: 'phaser-example',
    scene: Example
};

const game = new Phaser.Game(config);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions