• 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.

MSFS20 WASM gauge size

DragonflightDesign

Resource contributor
Messages
1,235
Country
northernireland
I've been working with the WASM Demo Gauge (GaugeAircraft in the SDK) as a starter into the world of programming MSFS with C++, but one thing beats me. Where is the size of the on-screen gauge specified? If we look at a panel.cfg entry:
Code:
[VCockpit01]
size_mm=1024,768
pixel_size=1024,768
texture=$SCREEN_1
background_color=0,0,255
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=WASM_Demo_Gauge.wasm&wasm_gauge=Compass, 0,0,1024,768
then AFAICS the position of the individual gauge is probably specified by $SCREEN_1. I would guess that this is defined in the aircraft VC? Changing the size parameters in the panel.cfg has no effect on the size of the gauge, but the code contains the following (example) line:-
Code:
nvgTranslate(nvgctx, p_draw_data->winWidth * 0.5f - 200, p_draw_data->winHeight * 0.5f);
So winWidth and winHeight are being defined somewhere but where?

-Dai
 
Why do you always pick on the one thing I haven't tried? :rotfl:Yes, that changes the onscreen size but not the position. I'm stilll thinking that's defined in the VC.
 
Changing the values of the first two of these numbers (0,0,1024,768) doesn't change it's position within the texture's footprint? It should.
 
Yes it does. Because I hadn't changed the pixel_size before, I hadn't seen any change when modifying the gauge position co-ords. You've also pretty much confirmed that like a P3D VC, the MSFS VC texture surface is defined in the 3DS model. I have a long learning curve on this... I do see the funny side of someone who reallly doesn't want to go anywhere near MSFS being able to answer my questions.

Thanks Ed!
 
I know nothing about WASM, never used it, but I have used previous versions of the sim before (fs9, FSX, P3D). I remember I used to get the on-screen gauge size, in pixels, dynamically through my code. I can't remember exactly but I can provide a code sample if needed, but I am sure you already know what I am talking about. Maybe it doesn't work with WASM on MSFS?

[EDIT] I found some old code in my cloud archive, something like:
Code:
PELEMENT_STATIC_IMAGE dibElement = (PELEMENT_STATIC_IMAGE)(pgauge->elements_list[0]->next_element[4]);
PIXPOINT dim = dibElement->image_data.final->dim;
dim provides the on-screen width and height.
 
Last edited:
Hello Eric

Yes; there's an example of that in the sd2gau doc, but it shows how to get the gauge background size rather than the size of an element within the gauge . Unfortunately you can't do it that way in WASM :rolleyes:
 
Back
Top