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

M:X and Y mouse scroll function

Messages
542
Country
australia
If I have a display screen of dimensions 400 x 400 and I want to move a
cross hair with the mouse using M:X,Y can I allocate /400 to both the
X and Y or is this restricted to either 1 or 100 ?

ie:
top left corner = 0,0
bottom right corner = 400,400

I have conducted searches for information on the scroll function
without any successful returns.

Any help or code sample would be gratefully appreciated.

Cheers
Karol
 
Hey Karol,

I dont know if this applies. I had a similar need for mouse movement on a 3D part. I found this way to control the mouse amount useage. Yours might be different, being a 2D gauge.


In the following code, I can adjust mouse movement amount via the following string;

Code:
	  100 (M:Y) - (L:DR400_CANOPY_MOUSEPOS,number) [COLOR="Red"][B]- 0.1 * [/B][/COLOR](L:DR400 CANOPY LATCH, number) + 0 max 100 min (>L:DR400 CANOPY LATCH, number)

in the section - 0.1 * I previously had a setting of -0.5 * and using 0.1 brought mouse movement lower.



Code:
<PartInfo>
        <Name>dr400_canopy</Name>
 <Animation>
  <Parameter>
   <Code>
    (L:DR400 Canopy Latch INITIALIZED,bool) 0 ==
    if{
      99 (&gt;L:DR400 CANOPY LATCH, number)
      1 (>L:DR400 Canopy Latch INITIALIZED,bool)
    }   
    100 (L:DR400 CANOPY LATCH, number) -
   </Code>
  </Parameter>
 </Animation>
	<MouseRect>
		<Cursor>Hand</Cursor>
	   <TooltipText>Canopy; Pull down to open, up to close</TooltipText>
	   <MouseFlags>LeftSingle+LeftDrag</MouseFlags>
    <CallbackCode>
	(M:Event) 'LeftSingle' scmp 0 ==
	if{
	  100 (M:Y) - (&gt;L:DR400_CANOPY_MOUSEPOS,number)
	  quit
	}
	(M:Event) 'LeftDrag' scmp 0 ==
	if{
	  100 (M:Y) - (L:DR400_CANOPY_MOUSEPOS,number) [COLOR="Red"][B]- 0.1 *[/B][/COLOR] (L:DR400 CANOPY LATCH, number) + 0 max 100 min (&gt;L:DR400 CANOPY LATCH, number)
	  100 (M:Y) - (L:DR400_CANOPY_MOUSEPOS,number)
	}
    </CallbackCode>
	</MouseRect>
</PartInfo>
 
Last edited:
lionheart

That's appreciated , it will give me somewhere to start , I will try to get
the X value to work with it.
Will start with 100 max , then substitute 400 to see if it still works , it will be interesting to see if the 100 is a value or 100% , at the moment I assume it is just an upper range value.

Cheers
Karol
 
Back
Top