Dynamic Texture fill fails in Canvas mode
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
Perhaps in the canvas render, the default value maybe not being set.
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.