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

Mouse click?

Messages
549
Country
nicaragua
Hey!
I have this trim gauge background:
trimbackground.jpg
Code:
<Gauge Name="s46_trim" Version="1.0">

<Image Name="trimbackground.bmp" Bright="Yes"/>

	<Element>
		
			<MaskImage Name="trim_mask.bmp">
				<Axis X="103" Y="178"/>
			</MaskImage>
			<Image Name= "vertical_line_trim.bmp" Bright="Yes">  		
				<Axis X="0" Y="0"/>
			<Nonlinearity>
			<Item Value="-90" X="-45" Y="0"/>
			<Item Value="0" X="0" Y="0"/>
			<Item Value="90" X="45" Y="0"/>

			</Nonlinearity>
			</Image>
			
		<Shift>
			<Value>(A:AILERON TRIM PCT, percent)</Value>
		</Shift>

	</Element>

<Element>
		
			<MaskImage Name="trim_mask.bmp">
				<Axis X="165" Y="108"/>
			</MaskImage>

			<Image Name= "horiz_line_trim.bmp" Bright="Yes">  		
				<Axis X="0" Y="0"/>
	
			</Image>
			
		<Shift>
		<Value Minimum="-90" Maximum="90">(A:ELEVATOR TRIM PCT, percent)</Value>
		<Scale Y="1.5"/>
		</Shift>
</Element>




<Element>
<Image Name="trimbackground.bmp" Bright="Yes"/>
</Element>
</Gauge>

And I'd like the + and - signs act like buttons but still on the background image, like, having an invisible are where you can click to increase or decrease the trim value.
Is that possible or do I have to make individual images for each button?

And, what's the code for a mouse click on FS9 gauges?

Thanks in advance!
 
Yet again I managed to find a tutorial on this, and again it didn't work:
Code:
<Mouse>
<Area Left="165" Right="193" Top="21" Bottom="49">
<Cursor Type="Hand"/>
<Click Event="KEY_ELEV_TRIM_UP" Repeat="Yes"/>
</Area>
</Mouse>

The pointer doesn't even turn into a hand! I tried to make the whole gauge clickable and it didn't work either!
 
There are examples of nearly every type of "gauge" one could ever want to create, but you have to look for them. The Beech Baron for example has an "Aileron Trim.xml" script that provides a good example from which to learn.

The simplest approach to setting up a "mouse area" is to define the top left corner of the "rectangle," followed by the height and width.

Consider the screenshot below. I've highlighted the left aileron control area with a red box. The top left corner of the red box is 34, 175. The red box has a height of 20 and a width of 69.

Allowing then for a few "empty pixels" of space between the left and right aileron control areas, we can calculate the right box by adding the left position (34) by the width of the box (69) plus 3 pixels: 34 + 69 + 3 = 106.

So, here then is the complete script for aileron control, based on your background screenshot:

Code:
    <Mouse>
        <Help ID="HELPID_GAUGE_ROLL_TRIM_KNOB"/>
        <Tooltip ID="TOOLTIPTEXT_ROLL_TRIM"/>
        <Area Left="34" Top="175" Height="20" Width="69">
            <Click Event="AILERON_TRIM_LEFT" Repeat="Yes"/>
            <Cursor Type="DownArrow" Repeat="Yes"/>
        </Area>
        <Area Left="106" Top="175" Height="20" Width="69">
            <Click Event="AILERON_TRIM_RIGHT" Repeat="Yes"/>
            <Cursor Type="UpArrow"/>
        </Area>
    </Mouse>

Follow the same procedure as above to calculate the mouse areas for elevator trim!

To get you started, here is the Beech Baron's elevator trim mouse script:

Code:
        <Help ID="HELPID_GAUGE_PITCH_TRIM"/>
        <Tooltip ID="TOOLTIPTEXT_PITCH_TRIM"/>
        <Area Bottom="30">
            <Click Event="ELEV_TRIM_DN" Repeat="Yes" MouseWheelFlip="Yes"/>
            <Cursor Type="DownArrow" Repeat="Yes"/>
        </Area>
        <Area Top="30">
            <Click Event="ELEV_TRIM_UP" Repeat="Yes" MouseWheelFlip="Yes"/>
            <Cursor Type="UpArrow"/>
        </Area>
 

Attachments

  • a_trim_01.jpg
    a_trim_01.jpg
    42.5 KB · Views: 475
Last edited:
Thanks!
I actually look at the default gauges, but because they're made with ACEs tool it becomes really confusing trying to figure things out!
 
Thanks!
I actually look at the default gauges, but because they're made with ACEs tool it becomes really confusing trying to figure things out!

That's why I suggested the Beech Baron's gauges. They are FS8/FS9 XML script.
 
Back
Top