Jump to content
Sign in to follow this  
Rocky

Transparent menu

Recommended Posts

Does anyone have a clue about the way to develop transparent menus?I would like to display transparent menus like the ATC menu. Ariane and AES have them (in fs9) but I can't find how to code this.I thought about getting the screen pixels in the menu area, change them so that it looks transparent and display the menu options, but this would be very CPU intensive. I'm sure there is a more efficient way of doing it.Any clue?Thanks in advance :)Eric

Share this post


Link to post
Share on other sites

I have succeeded in creating a semi-transparent window in fs9, using the standard Windows API. The problem I have is that it works only in windowed mode, as shown on the attached picture. If I switch to full-screen mode, my window disappears.Any help available ?Eric

Share this post


Link to post
Share on other sites

EricI'm not sure if the following is of any use to you , but i created a transparent pop up windowthat appears as an overlay on panels .It is an approach speed chart and gauge its a part of the F-111 Pig HUD project , is freeware,file reference fxpiggb5.zip .CheersKarol

<Gauge Name="APPROACH SPDS CLIPBOARD" Version="1.0">//By Karol Chlebowski @ 2009 **<Size X="460" Y="460"/><Element><Element>          <Position X="162" Y="50"/>           <Text X="84" Y="20" Bright="Yes" Length="60" Font="Tahoma" FontSize="16" Color="#93FF72" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No">            <String>%ONSPEED%</String>           </Text>    </Element><Element>        <Position X="0" Y="76"/>        <FormattedText X="366" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,90C,160C,258C,332C">          <String>\tFUEL%%\tA/C Wt\tAPP\tTCHDWN\n</String>  </FormattedText>      </Element><Element>        <Position X="0" Y="96"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t16\t68,290\t126\t121\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="116"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t24\t70,940\t128\t123\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="136"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t32\t73,540\t131\t125\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="156"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t39\t76,100\t133\t127\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="176"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t48\t79,050\t136\t130\n</String>  </FormattedText>      </Element>       <Element>        <Position X="0" Y="196"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t58\t82,250\t139\t133\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="216"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t66\t85,100\t142\t135\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="236"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t73\t87,630\t144\t137\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="256"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t82\t90,640\t145\t139\n</String>  </FormattedText>      </Element>      <Element>        <Position X="0" Y="276"/>        <FormattedText X="362" Y="16" Font="Tahoma" FontSize="16" LineSpacing="14" Adjust="Left" Color="#93FF72" Bright="Yes" Tabs="0,95C,160C,258C,332C">          <String>\t93\t94,350\t149\t142\n</String>  </FormattedText>      </Element>         <Element>          <Position X="100" Y="306"/>          <FormattedText X="150" Y="130" Font="Tahoma" FontSize="20" LineSpacing="24" Adjust="Left" Color="#349F34" Bright="Yes">            <String>%ACRFT WT%\n%FUEL%((A:FUEL TOTAL QUANTITY,gallons) 100 * (A:FUEL TOTAL CAPACITY, gallons) /)%!3d!% %%%</String>          </FormattedText>        </Element>    <Element>          <Position X="177" Y="306"/>          <FormattedText X="100" Y="130" Font="Tahoma" FontSize="20" LineSpacing="24" Adjust="Right" Color="#349F34" Bright="Yes">            <String>%((A:TOTAL WEIGHT, pound))%!6d! lb%\n%((A:FUEL TOTAL QUANTITY WEIGHT,pounds))%!5d! lb%</String>          </FormattedText>        </Element></Element></Gauge>

Share this post


Link to post
Share on other sites

Karol -do you have a screenshot of what you posted? I found your file in the lib but the attached pictures don't show that thing I believe.Eric, as far as I know you have worked with C more than XML in the past; I am sure you have looked into SimConnect then? I believe you have access to those transparent menus just like ATC does. It should be possible to have custom entries there and just do whatever you need to do with it.

Share this post


Link to post
Share on other sites

Karol,Thanks for your help. As badderjet said, a screenshot would help seeing what you have done, but I guess it is a transparent gauge that displays strings on top of the panel or outside view. As badderjet said, I am more familiar with C++ than XML, and I know how to do this kind of gauge in C++ too. The problem is that it is not exactly what I want here. What I want is exactly what the ATC menu shows: a semi-transparent background (a kind of transparent grey on top of the screen) with non-transparent white strings. I wish I could find some kind of "hidden API" to re-use the fs9/FSX ATC menu system, but I couldn't...@Badderjet: I am nit interested in a SimConnect-based solution at this time becuase I need to have it working on both fs9 and FSX. I know I am demanding much...Thanks again to you all for your help !!Eric

Share this post


Link to post
Share on other sites

Perhaps I've overlooked the obvious (what - again? :( ) but what about this?http://code.msdn.microsoft.com/ESPDrawingGaugesGDI-Dai

Share this post


Link to post
Share on other sites

The following shot shows the applicable instrument boxed in red.The stall light boxed in yellow incorporates the hide/display (on/off switch).If the underlying instrument was switched on, then it would be visible with the text remainingvisible as an overlay.As you may have noticed, the code does not incorporate a background Bitmap.The upper text is a fixed chart, while the lower different coloured text is constantly updatedaircraft and fuel weights whose figures are used as an entry parameter to the upper chartto determine the correct onspeed airspeed for landing at the aircrafts current weight.This chart instrument is moveable, however the mouse must be precisely set on a piece of textto initiate a click and drag function.CheersKarol11tmko4.jpg

Share this post


Link to post
Share on other sites

Thank you for the screenshot. Indeed, it shows exactly what I understood. I have developed the same kind of gauge in the past, as shown on the attached image. I have added 2 red bars to move the gauge more easily because as you said, a colored pixel must be picked to move it.But it is not exactly what I want today because I would like to have a semi-transparent background, like the ATC menu. But maybe I ask too much...Eric

Share this post


Link to post
Share on other sites

EricYour projects have been brilliant , wishing you all the best with the semi transparent background .CheersKarol

Share this post


Link to post
Share on other sites

Hi,In xml a semitransparant background is not the problem, but to catch the atc text in a mfd like acars.Use rectangles with transparancy="0 to 1" and all decimal values between and any colour you want.The rectangles with different transparancy become visible by another L:Var. (Dimknob)Use as last element in a gauge.With this method one can "dim" or "brighten" the pfd, mfd and eicas.Jan

Share this post


Link to post
Share on other sites

I didn't think about this, it might be a good idea, thanks for the clue.I don't know if it can solve my problem because my plan is to create a module and not a gauge. I don't know if I can use the XML transparency in that case, but I will try...Thanks,Eric

Share this post


Link to post
Share on other sites

I finally found the best solution, according to what I was looking for. I could finally re-use the ATC-like semi-transparent menus that exist in FS :( EricTransparency.jpg

Share this post


Link to post
Share on other sites
Guest fatcharlie

Hi Jan,I am trying to overlay a 'semi transparent' image in an xml gauge, to simulate the reflection from the perspex cover.It looks as if you are talking about this in your post, but I wonder if you could give an example of the syntax to use in the xml file?many thanks,Roger.

Hi,In xml a semitransparant background is not the problem, but to catch the atc text in a mfd like acars.Use rectangles with transparancy="0 to 1" and all decimal values between and any colour you want.The rectangles with different transparancy become visible by another L:Var. (Dimknob)Use as last element in a gauge.With this method one can "dim" or "brighten" the pfd, mfd and eicas.Jan

Share this post


Link to post
Share on other sites

Hi,Use:<Element><Rectangle Linewidth=".." etc. etc. Transparency=".." etc /></Element>See:http://msdn.microsof...x#mozTocId33639Transparancy between 0 and 1.Doesn't work placed over the outside world, only over some background(color).Jan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...