Are you trying to listen for an event happening inside the canvas from outside the canvas?
Or are you just trying to figure out how to listen to events inside the canvas using the playcanvas scripting api?
Tell us a bit more about what you are trying to acheive so we can help =)
Also sharing a link to the proyect or snapshots usually makes things more understandable
To clarify, I don’t want the page to reload, I want to update some content on the page, like this:
document.getElementById('button').addEventListener('click', function(e){
// Update text on click
document.getElementById('button').innerText = "Loading..."
// Update text once the model has loaded in PlayCanvas
document.getElementById('button').innerText = "Click me to load a model"
})
Now you need to figure out how to create a new Asset from whatever data you provide. It will depend on the type of asset you want and the data you provide.
the first parameter (“a texture”) is for assigning a name to the new asset.
the second parameter (“texture”) is an asset type. asset types can be: “animation”, “audio”, “binary”, “container”, “cubemap”, “css”, “font”, “json”, “html”, “material”, “model”, “script”, “shader”, “sprite”, “template”, “text”, “texture”