Hello Community!
I’ve been trying to make a paint-like environment using Phaser and Render Textures.
It seems that everytime I resize or setSize to the RenderTexture, my drawings are destroyed.
According to Phaser’s RenderTexture resize method source code:
this.renderer.deleteTexture(this.frame.source.glTexture);
this.renderer.deleteFramebuffer(this.framebuffer);
this.frame.source.glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false);
this.framebuffer = this.renderer.createFramebuffer(width, height, this.frame.source.glTexture, false);
this.frame.glTexture = this.frame.source.glTexture;
The example in Phaser 3 Examples page is broken and outdated.
Is there a way I could get a hold to what’s been drawn, resize and then redraw it?