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

FSXA XML Vectorial Mask

Messages
204
Country
portugal
Hello people.

I'm working on a XML "Collins" EADI, all vectorial, I mean no bitmaps, only colors, polylines, poligons and text.
In fact, it is finished already, and it's looking pretty sharp and clean.
But I need to apply a mask on the display, to size it, and most important, to round its corners. I did it with a bitmap mask, but when poped up at a bigger size, the bitmap shows its shark teeth "pixelazation" of the round corners.
Is it possible to apply a vectorial mask? Something to smooth the round edges?

Thanks.
 
Something to smooth the round edges?

I've not tried this before, but in FSX one can use Arc Objects to draw arcs (curved lines) as part of the gauge. Appropriately positioned and colored, could you not cobble together a rounded corner mask?

http://msdn.microsoft.com/en-us/library/cc526953.aspx

Find the "Arc Objects" section, then experiment, I guess... Hope this isn't sending you off on a 'rabbit trail'.

Bob
 
Last edited:
I've not tried this before, but in FSX one can use Arc Objects to draw arcs (curved lines) as part of the gauge. Appropriately positioned and colored, could you not cobble together a rounded corner mask?

http://msdn.microsoft.com/en-us/library/cc526953.aspx

Find the "Arc Objects" section, then experiment, I guess... Hope this isn't sending you off on a 'rabbit trail'.

Bob
The Arc Objects, as with "Pie Objects", they do draw perfect curved lines, but I can't use them as masks. If the display was a static image, this could be easily done with Arc/Pie and rectangles; but when the display is the artificial horizon (half blue, half brown), and has shift and rotation movements, I have to create a "mask window" so the horizon moves inside it.

Another object that is almost perfect for this, is the "ClipRect". This one creates a rectangular mask, the problem is that I need the round corners to match the EADI face. So what I need is a compound mask of rectangles and arc objects. I'm sure it can be done, but I've yet to figure out...
 
So what I need is a compound mask of rectangles and arc objects. I'm sure it can be done, but I've yet to figure out...

A compound object is what I thought you would need to make, as well. I had the simplistic notion that 5 objects - four circles and a rectangle with small squares cut out of the corners (defined by 12 points), would do it. If you can create circles and fill them with 0 0 0, then I don't see why not. But, it's all very easy for me to say because I have never tried it. So, you are absolutely set against including even one bitmap?

Bob
 
Last edited:
XML is the biggest PITA when trying to use vector graphics only....GDI+ is far more flexible...
 
The Arc Objects, as with "Pie Objects", they do draw perfect curved lines, but I can't use them as masks. If the display was a static image, this could be easily done with Arc/Pie and rectangles; but when the display is the artificial horizon (half blue, half brown), and has shift and rotation movements, I have to create a "mask window" so the horizon moves inside it.

Another object that is almost perfect for this, is the "ClipRect". This one creates a rectangular mask, the problem is that I need the round corners to match the EADI face. So what I need is a compound mask of rectangles and arc objects. I'm sure it can be done, but I've yet to figure out...

I think you could use a bitmap with alpha; not as a mask but as regular bitmap over the complete vectorial area.

I mean, you code something like this (pseudocode)

Code:
<Vectorial elements>
  <one>
   <two>
   <etc>
</vectorial elements>

<Element image with alpha>
   covering the <Vectorials>
   <Image xxx Alpha="Yes">
</Element>

I used this approach for a 757 PFD many years ago. Need to find those bmps and gauges though...

Tom
 
XML is the biggest PITA when trying to use vector graphics only....GDI+ is far more flexible...
Yep, but like we use to say in my country, if you don't have a dog, go hunting with a cat... :D

I think you could use a bitmap with alpha; not as a mask but as regular bitmap over the complete vectorial area.

I think I know what you mean. The alpha might be a solution, I'll try that.
Thanks.
 
Here is the result on the display upper left corner:

No alpha on the left, and with alpha on the right
eadialpha.jpg


The image w/ alpha uppon the artificial horizon seems to achieve a fairly acceptable result. ;)
Thanks Tom.
 
By the way, if someone knows how to get rid of that nasty font "shadow"...

eadi2.jpg


The only workaround I found was to assign a background of the same color of the font (see the AP and YD annunciator on the previoious post), but as the horizon moves some text gets over the "other side" and things get wierd... :( apart from this everything works ok...
 
By the way, if someone knows how to get rid of that nasty font "shadow"...

Joao,

Thanks very much for this note. Assigning a font BackgroundColor the same as the image background color is finally the answer to a post of mine last year!

http://fsdeveloper.com/forum/showthread.php?t=97726

and

http://forum.avsim.net/topic/348997-poor-quality-text-in-fsx-gauge/

BTW, I find this problem only in FSX, not in FS9, but it has been a principal reason that I don't use FSX nearly as often as FS9.

If there are alternative solutions to the text shadow problem, I'd like to hear those too.

Thanks again Joao!!

Rgds,

Bob
 
If there are alternative solutions to the text shadow problem, I'd like to hear those too.
Semitransparent polygon (for dimming) placed over the text should kill these shadows.
 
I'm afraid I didn't understand very well: semitransparent polygon? :confused: Can you explain that?

This is code from my HUD:
Code:
<Rectangle FillColor="#22AA11" Transparency="0.5" Width="256" Height="306" Bright="Yes"/>
(Transparency = 0.0...1.0)

hth, L.
 
This is code from my HUD:
Code:
<Rectangle FillColor="#22AA11" Transparency="0.5" Width="256" Height="306" Bright="Yes"/>
(Transparency = 0.0...1.0)

hth, L.
Ah, that's a rectangle, and in fact it's the only object that has a transparency parameter, I was confused when you refered polygon...
So that is a greenish rectangle 50% transparent all over the entire HUD, I suppose? And you say it might clear up the text "shadow"?
I'll try that, thanks.
 
Font shadows in FSX

Joao,

Your BackgroundColor solution to mitigate font shadows in FSX might be a good FSDeveloper wiki addition.

I know your sim is FSXA, but you are using FS9 XML syntax, not FSX, is that correct? I don't know anything about FSX syntax, but reading the SDK makes me wonder if text properties Alpha and Transparent could be used to eliminate the text shadow. No clue.

Bob
 
Last edited:
Ah, that's a rectangle, and in fact it's the only object that has a transparency parameter, I was confused when you refered polygon...
So that is a greenish rectangle 50% transparent all over the entire HUD, I suppose? And you say it might clear up the text "shadow"?
I'll try that, thanks.
No joy. This won't do. In a XML based HUD, a dimmer might reduce the shadowing, but it is there, at least in the one I checked. A higher sized font also helps to reduce the problem, but doesn't solve it.
Anyway, thanks for the tip.

Joao,

Your BackgroundColor solution to mitigate font shadows in FSX might be a good FSDeveloper wiki addition.

I know your sim is FSXA, but you are using FS9 XML syntax, not FSX, is that correct? I don't know anything about FSX syntax, but reading the SDK makes me wonder if text properties Alpha and Transparent could be used to eliminate the text shadow. No clue.

Bob
Bob,

I code all my gauges in FSX XML syntax. I only use FS9 XML on GPS based gauges (like FMS) or when there is something not supported by the ACES tool, of which I'm a big fan (maybe the only one around :o).

Now about the font shadows, I believe this happens because in FSX, text is antialiased to a default black background color (0x000000). When we set the font to transparent, the pure black becames transparent but some "not pure black" pixels do appear around the type. That's why the same color background shows no "shadow" anymore - the font is now antialiased to its background color. I believe the problem wouldn't happen if the text was antialised to its background color, and still we were able to set this background color to transparent. This way text would be perfectly antialiased with the scene background. The alpha property might be a solution, but I've yet to figure out how to use it on text.
 
This is the best I can come up with:
eadi3.jpg

All text use the same "scene" color background, to eliminate the "shadowing" problem.
But because the background moves, I used a little trick, so the text don't appear with the wrong color background.
Based on the ATTITUDE INDICATOR variables I used the parameter BackgroundColorScript to switch the text to background to transparent, when the undesirable situation occurs, as you can see on the Outer Marker as an example.
Anyway, I don't like it very much this way.
Guess I can make the very same gauge with bitmaps, with similar quality.
But the text "shadowing" will still arise for the radar altitude and decision height display. :mad:
 
Guess I can make the very same gauge with bitmaps, with similar quality.
But the text "shadowing" will still arise for the radar altitude and decision height display. :mad:

I recall of this issue with text strings when programming a PFD. I figured out an acceptable solution by using bitmaps instead, as you guess. First I made a background with a similar (but not equal) color from the foreground text; flattened both images and then made the bg transparent replacing its color with pure black.
Shame that I cannot find the folder where I stored those old files:(

Tom
 
Joao,

Do you have any good images of the collins EADI? I am trying to find a brochure from collins or something but I got nothing. I'm wondering what you used to work on this? I trying to make the same guage and also the EHSI.
 
Joao,

Do you have any good images of the collins EADI? I am trying to find a brochure from collins or something but I got nothing. I'm wondering what you used to work on this? I trying to make the same guage and also the EHSI.
I couldn't get any decent images.
I used the Aeroworx FS9 King Air B200 gauges as a guide, it was the best I could find.
I never get to publish my EADI and EHSI, they are coded in XML.
I'll try to put it together and upload them to AVSIM.
Maybe you can use them instead of redoing them. :)
 
Back
Top