• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS Should a very simple html gauge work in MSFS2020?

Messages
3
Hi,

I am in the process of creating (custom) gauges and integrating them into my (custom) aircraft.
Due to the low complexity that I need, I will use html.
I'm sorry in advance if this post seems very basic and low-level. I'm trying my best to keep everything very simple and not make things unnesessarily complicated to read.

So I created this VERY simple html code, which just draws a div with aqua-type color.
No css, no js etc.
This is not working as intended (The object will only change it's color to BLACK).

HTML:
<!DOCTYPE html>
<div id="test1", style="background-color: aqua; position: absolute; top: 20px; left: 20px; width: 500px; height: 500px"> </div>

panel.cfg:
Code:
;some comment

[Vcockpit01]
size_mm = 2000, 2000
pixel_size = 2000, 2000
texture = $SCREEN_4
background_color = 128, 128, 128
emissive = 0
htmlgauge00=Generic/Misc/custom_test01/gauge_custom_test01.html, 0, 0, 2000, 2000

The question is: Sould that work? Without any handlers in js?

When I change the color of the <body> in the html file, the gauge object will change to this color.
But Text, divs, or any other elements are still not visible.
E.g. Adding this to the beginning of the html file:
HTML:
<style>
    body {
        background-color: linen;
        height: 2000px;
        width: 2000px;
    }
</style>

I'm ready for further questions etc.
Thanks in advance!
 
Hi Anthony,

thanks for your response!
I actually just managed to implement your example into my custom aircraft, without any changes to the community folder beforehand.
Wasn't working before, but that was my error.

Wasn't that complicated... but sometimes I feel like standing infront of a huge wall.
It's little things like in the panel.cfg, the path is not relative to html_ui (that would be too easy :) ).
And docs.flightsimulator.com definitely helped... not at all.

But on the other hand, I'm already used to things not being documented by Microsoft.

Thank you for your excellent example and time!
 
Back
Top