I want to put an html5 canvas element on top of a unity webplayer.
I’m aiming to clear the rectangle where the webplayer is through either a clearRect
of the 2d canvas or a scissor test on a GL context, so that I can have the unity webplayer content to appear on the part of the canvas where I’m not rendering anything nor clearing.
This way I could render my content on top of the unity webplayer through the html5 canvas.
I tried setting the css attribute z-index
of the <embed>
element and all of his parents to a lower value than the same attribute on my canvas but the webplayer seems to always render on top of everything.
I have tried waiting for the embed to load before creating my canvas but it doesn’t seem to have any effect, the unity plugin seems to wipe out the screen pixels where it’s placed anyway.
Can I do what I want somehow?