Skip to content

Dynamic Texture fill fails in Canvas mode #6682

@samme

Description

@samme

Version

  • Phaser Version: 3.70.0

Description

Create a game with the Canvas renderer.

Create a Dynamic Texture, fill with a color, and add an Image with the texture.

No fill appears.

Example Test Code

class Example extends Phaser.Scene {
    create() {
        this.textures.addDynamicTexture('area1', 128, 128).fill(0x00ff00);

        this.add.image(100, 100, 'area1').setOrigin(0);
    }
}

const config = {
    type: Phaser.CANVAS,
    scene: Example
};

new Phaser.Game(config);

No green appears. Compare with Phaser.WEBGL.

Additional Information

The texture has width and height -1 and these are used in

https://github.com/photonstorm/phaser/blob/47d393ac2900da02dfe35fc673050cefcb9a0d82/src/textures/DynamicTexture.js#L427

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