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

Hidden click spots and mouse drag.

Messages
407
Country
ca-britishcolumbia
I am animating multiple bugs on the airspeed indicator on my DC8 and can't seem to find the information I need for mouse dragging code. As it stands, I have left click and drag to move each bug one way and right click and drag to move it the other. That's pretty awkward to use. What I would really like is just left click and drag with dragging horizontally to the left decreasing the value and to the right increasing it. I'm not sure how to code that although I'm pretty sure it's possible.

The other problem is that these bugs make too small a click spot when the VC is bouncing around, especially when they're bunched up together. So I would like to have fixed hidden click spots along the top of the gauge. That way I could also use the mouse wheel to move the bugs as well. Is it possible to have an invisible click spot, or do I have to separate a polygon from the visible mesh as a new object?

Any pointers would be great.
 
I figured out the mouse dragging by looking at some of the examples found in the modeldef.xml file. Still not sure about the hidden click spots. Can I use dummy objects?
 
Sorry, any hidden poly can not be clickable.

How about full transparency of the poly hovering over the knob?
 
I have a generic transparent .dds file somewhat obscurely named: transparent.dds... It is 32x32 pixels and I use it whenever I need to have an invisible mouse rectangle polygon.

As for the Vspeed indicators, here is the script I use for them (I have four). Left-click + MouseDrag works in both directions. Mouse rect is applied directly to the pointer object(s).

Code:
  <Animation name="B737_Vref1" guid="18F9F7A1-D0A6-48bf-1111-777240386A1A" typeParam2="B737_Vref1" length="400" type="Sim" typeParam="AutoPlay" />


  <PartInfo>
    <Name>B737_Vref1</Name>
    <AnimLength>400</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_Vref1, enum) 10 +</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 !=
        if{
        (L:B737_Vref1X1, position) s0 0 !=
        if{
        (L:B737_Vref1, enum) (M:X) l0 &lt;
        if{ 1 + 400 min } els{ l0 (M:X) &lt; if{ 1 - 0 max } }
        (&gt;L:B737_Vref1, enum)
        }
        }
        (M:X) (&gt;L:B737_Vref1X1, position)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Last edited:
Thanks for the reply Bill. I did get it working the way I wanted before seeing your post by finding an example in the model.def file and making some minor changes.

The way I have it now, the bugs are the click spots, but I find them very difficult to click using track IR with VC shaking from turbulence, so I will probably go to a row of transparent polys above the gauge for that.
 
The way the script I wrote works is that as long as you are "on" the bug when you click, it won't "release" the bug until you release the mouse button. Admittedly it can sometimes be a bit tough to snag the bug in turbulence... :confused:
 
Mine works the same way -- the problem is the initial click. I'll try it out for a while before going to large invisible click spots. I guess I could use both. It's certainly more intuitive to click on the bug than some invisible spot above the airspeed indicator.
 
The nice part is that you can use the same modeldef.xml entry for both methods. :cool:
 
Back
Top