Closed Jugacu closed 5 years ago
Sorry, but no, the correct way is to use the Texture Manager, so that the correct objects are created internally. Your approach ignores the fact that Textures require a reference to the Texture Manager in order to be constructed properly and also that Game Objects need a Texture and a Frame in order to render.
You cannot just dump a canvas DOM element on a Sprite and expect it to render I'm afraid, that just isn't how WebGL works. It needs to be converted into a WebGLTexture first.
Description
When i try to create a Phaser.Textures.Texture from a canvas already drawn and assign it to an sprite via Phaser.GameObjects.Sprite.texture it wont render.
It does work if i use the texture manager but i feel like that other way should work aswell
Example Test Code
https://codepen.io/anon/pen/bPyNXy