Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Texture fill fails in Canvas mode #6682

Closed
samme opened this issue Dec 1, 2023 · 2 comments
Closed

Dynamic Texture fill fails in Canvas mode #6682

samme opened this issue Dec 1, 2023 · 2 comments

Comments

@samme
Copy link
Contributor

samme commented Dec 1, 2023

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

@gammafp
Copy link
Collaborator

gammafp commented Dec 22, 2023

Perhaps in the canvas render, the default value maybe not being set.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants