Add Custom DOM Object to Stage - Scene Only

How do I…

I’ve created an extension to add HTML elements to my game like a select. It works great and I thought I had it all figured out. I am able to use scene event to create a select at a position, detect change, add options, get the value, and delete it. However, when I change to a new scene, the select is still sitting there in the same position. The instance persists across scenes.

I noticed another extension, the iFrame extension, behaves in the same manner. I’d like the element to exist in the current scene only.

How do I add a DOM element to the stage only? Can I create a SceneObject and attach the HTML element to it?

Below are some screenshots of my code. The create function:

Entire create code:

Any suggestions? Thanks in advance.

1 Like