Hello, I would like to create some gauges (like PFD, or custom G1000, G3000
etc…) But We have a lot of information in the SDK on how to setup, or make a
package, but I can’t find an example on how to make a gauge (PFD or GPS) Are
you using WASM or HTML ? What is the best ? I don’t really understand, WASM is
for the script but how do you add a map to your code, or special design ?
Thank you very much. Regards, Thomas - PESIM
This seems like a very broad question but I’ll share my thoughts to hopefully
be of help.
Are you using WASM or HTML? What is the best?
Like the SDK mentioned, Instruments
(flightsimulator.com)
“neither is better than the other”. It’s really up to you to choose the
framework that suits your needs. They both have their pluses and minuses.
WASM: WASM can have graphics, it’s not just “for scripts”. But the drawing is
provided via NanoVG API (GDI+ like) so very primitive. We are talking about
lines, boxes, circles, etc. HTML/MSFS Avionics: HTML and javascript. You can
use it “for scripting” too but being HTML makes it easy to prototype/debug the
“UI” i.e. the gauge’s graphics. You can literally “refresh” the page to see
updates without needing to recompile C++ code which makes it easy to make
complex UI in my opinion. In our project, we are making a moderately complex
aircraft and it has both WASM and HTML gauges since both are good at
something.
add a map to your code
I am assuming you meant something like a “google map” type of map. You might
have better luck using HTML to interact with external APIs (e.g. open street
map). Check out this part of the SDK Debugging HTML/JS/CSS Instruments
(flightsimulator.com)
where they showcased loading an internet image that could be helpful.
Hello. Adding a few information to your answer: - WASM now allows to edit and
continue if you want to see your modifications on the fly, similarly to what’s
possible with the Coherent debugger: WebAssembly
(flightsimulator.com)
- WASM now exposes a network API if you are looking for a way to download
content in your wasm module. (The NetworkAircraft sample we provide with the
SDK downloads images from a website) Network API
(flightsimulator.com)
Regards, Sylvain