Inverse of HTMLElementTexture?

Is there any way to do the exact opposite of HTMLELEMENTTEXTURE. Basically take a texture being created and updated in babylon, and get that back out to a canvas or html element that is being mirrored on an HTML UI layer?

Seems that this page could be helpful - Dynamic Textures | Babylon.js Documentation
You can obtain the canvas context using

var ctx = myDynamicTexture.getContext();

exposing all the possibilities of the HTML5 canvas element.


Perfect! That is exactly what we were looking for. Many thanks!

1 Like

make sure after you update the context though to call dynamicTexture.update() or you wont see your modifcations.