- Messages
- 245
- Country

Hopefully a quick question here... if I have a happily working HTML/JS gauge connected to a $texture on the panel, how can I define an area on that gauge that if I click it, code gets called within the gauge?
I have the following clues:
In the gauge JS class, define:
My basic confusion is somewhere you need to define areas on the gauge you're interested in 'interaction events' and/or how do the events appear in
The msfs-webui-devkit debug tool is the only example I found of a 'gauge' you can interact with, but that uses absolutely stock JS methods e.g.
so bypassing onInteractionEvent(_args) entirely.
The examples I can find in Asobo aircraft are NOT for touch panels, the events come from animated buttons and knobs around the periphery of the gauge defined in the 3D model and referenced in the model XML - I'm ok with those.
OR??? maybe
Any help, as always, much appreciated.
I have the following clues:
In the gauge JS class, define:
get isInteractive() { return true; } // I think this is required for you to click on the gaugeget isGlassCockpit() { return true; } // No idea what difference this makesonInteractionEvent(_args) { ??? no idea what goes in here } My basic confusion is somewhere you need to define areas on the gauge you're interested in 'interaction events' and/or how do the events appear in
_args above?The msfs-webui-devkit debug tool is the only example I found of a 'gauge' you can interact with, but that uses absolutely stock JS methods e.g.
document.getElementById("rfrsh").addEventListener("click", function () { ... })so bypassing onInteractionEvent(_args) entirely.
The examples I can find in Asobo aircraft are NOT for touch panels, the events come from animated buttons and knobs around the periphery of the gauge defined in the 3D model and referenced in the model XML - I'm ok with those.
OR??? maybe
onInteractionEvent() is purely for handling events that do come from 3D model parts linked to the model XML file ??? That could make sense, maybe?Any help, as always, much appreciated.