Canvas+ Overlay canvas


Hey all,

Quick question, is it possible in Canvas+ to overlay a 2d canvas on top of a webgl one or can it only support a single canvas element ?

Alternatively, would it be possible to create an off-screen canvas, render to that and then merge them together ?
IE render 2d stuff to offscreen canvas, use this as a texture and then draw this onto the primary webgl context ?



You should be able to do both things. I would recommend your off-screen canvas idea.

Have fun!


Ok thanks for the info!

I’ve tried the first option, doesn’t seem to be working for me.
I have a screencanvas with z-index 1, position:absolute(0,0) running a webgl context
and a regular canvas z-index 2, position:absolute(0,0) running a 2d context

the webgl context is visible, but not the regular 2d one. I’ve also tried using canvas instead of screencanvas, same result.
I will try option 2, as I think it’s a better solution anyway.

It does work under webview+ (which i guess is to be expected).


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.