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

Cannot use renderTexture.snapshot in canvas rendering mode #5448

Closed
akeboshi1 opened this issue Dec 15, 2020 · 2 comments
Closed

Cannot use renderTexture.snapshot in canvas rendering mode #5448

akeboshi1 opened this issue Dec 15, 2020 · 2 comments

Comments

@akeboshi1
Copy link

Version

  • Phaser Version:v3.50.0-beta.13
  • Operating system:Linux
  • Browser:chrome

Description

Cannot use renderTexture.snapshot in canvas rendering mode,
The canvas inside canvasrender is undefined

Example Test Code

https://codepen.io/akeboshi1/pen/eYdvgry

Additional Information

image

@akeboshi1
Copy link
Author

akeboshi1 commented Dec 15, 2020

My current alternative is to create canvastexture.drawframe to merge dynamic atlas。
const canvas = this.scene.textures.createCanvas("key", width, height);
canvas.drawFrame("drawKey", texture.firstFrame, x, y);
const url = canvas.canvas.toDataURL("image/png", 1);
this.scene.textures.addBase64("key", url);
canvas.destroy();

@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