Skip to content

lineWidth of grid game object not working on WebGL mode #7029

Closed

Description

@AlvaroNeuronup

Version 3.86.0

  • Browser: Tested on edge, chrome.

Description

Grid object lineWidth only works on Phaser.Canvas.
Expected behaviour: Both modes must show the same result.

Example Test Code

class MainScene extends Phaser.Scene {

    constructor() {
        super({ key: "MainScene" });
    }

    create() {
       const grid = this.add.grid(200, 200, 200, 200, 40, 40, 0xff00ff, 0.2, 0xff0000);
       grid.lineWidth = 10; // Only works on CANVAS
    }
}

const game = new Phaser.Game({
    type: Phaser.WEBGL, // Phaser.CANVAS
    width: 800,
    height: 800,
    backgroundColor: '#ffffff',
    scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH
    },
    scene: [ MainScene ]
})

Activity

  1. zekeatchan commented on Mar 17, 2025

    @zekeatchan
    Contributor

    Hi @AlvaroNeuronup. Thanks for submitting this issue. We have fixed this and pushed it to the master branch. It will be part of the next release. Do test it out and let us know if you encounter any issues. Keep in mind the way lineWidth renders in Canvas and WebGL mode is slightly different so the results will differ.

  2. added a commit that references this issue on Mar 17, 2025
    87796a9
  3. locked as resolved and limited conversation to collaborators on Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions