I have seen this example (https://playcanvas.com/editor/project/751877) where the iframe is added to a plane having renderer attached. I am trying to achieve the same with an image. I have changed the code from:
this.entity.renderer.material = material;
this.entity.element.material = material;
but it does not really work. Can anyone help me? I have created an example project here:
It’s not clear to me what you’re trying to do. Are you trying to add the material to the plane? Or do you want the plane to show the iFrame?
I am trying to add iframe in the 2D image. The 2D image has a material right? So how do I display the iframe in it?
Off hand, I don’t think this iframe method works with 2D screenspace elements because the whole system relies on a 3D world position and orientation.
You would have to create your own iframe ‘plane’ for 2D elements to handle the position, size and rotation of the iframe DOM object.