• 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 2020 Gunsight/HUD

After several attempts we managed to have a gunsigh for MSFS 2020, stealing the idea to B787.
Simply adding this (undocumented) line to a VCockpit:
The exact meaning f parameters is still undocumented, however it sems that:
- 1st param alpha channel 0 = opaque, 1 full transparency
- 2nd/3rd seems to be position coordinates
- 4th/5th unknown
may someone knows the exact meaning
// gun sight
htmlgauge01=WasmInstrument/WasmInstrument.html?wasm_module=fiat-gina.wasm&wasm_gauge=gunsight, 0,0,1024,1024
However still some issues remain about transparency:
NVGcolor mycolor = nvgRGBAf(255, 255, 255,alpha);
I expected it varies from 0 to 1 to set transparency, but is not, it seems just a multiplier of rgb components.
Another problem is the rendering persistence, expected that drawing a rect before others drawing would refresh the canvas,
but is not, rendering seems persistent, so the only solution i had was to revert to rgb(0,0,0) to erase the circle which is not a nice solution.
Any ideas ?
Last edited:
nvgRGBAf function get arguments with values from 0.f to 1.0f (float) and default value for alpha is 1.f
nvgRGBA function get arguments with values from 0 to 255 (unsigned char) and default value for alpha is 255.
If alpha channel behavior is not how you intended, maybe to look at NVGcompositeOperation or NVGblendFactor.
I think that persistent you describe is a feature, so you don't need to redraw gauge if nothing has changed (complex map for example) and save computing resources.
Thanks for replay,
will investigate functions you mentioned, yes i need to redraw frequently since i'm trying to mantaing the gunsight collimated using POV accessing functions that SimConnect (should) provide us, but actually all these return void data.