Just curious if you will add this functionality to transparent canvas button (What this script is doing in in future)
var TransparetnBg = pc.createScript('transparetnBg');
// initialize code called once per entity
TransparetnBg.prototype.initialize = function() {
var bd = document.getElementsByTagName('body')[0];
var ht = document.getElementsByTagName('html')[0];
var cv = document.getElementsByTagName('canvas')[0];
bd.style.backgroundColor="transparent";
ht.style.backgroundColor="transparent";
cv.style.backgroundColor="transparent";
};
The code was a difference ,I just added a new entity and added the code to it
Everything worked perfectly
Note (these were the settings previously but they don’t worked without script)
the cam was alpha with color to 00000
the transparent Canvas button was ticked
With button I mean
Settings/Rendering/transparent canvas button
The transparent canvas option in the Project Rendering settings along with a fill colour on the camera being transparent will allow DOM elements behind the canvas to be seen
This is used by 8th Wall, Zappar etc to allow a video feed to be placed behind the canvas and be seen.
For the body/html, we haven’t had a request for this as it’s been not a common user path with a few exceptions. Generally developers have been fine modifying the CSS of the build for self hosting.