Canvas ND framework: Difference between revisions

Jump to navigation Jump to search
m
→‎Development: this still needs more wiki markup to look "good"
m (→‎Adding the navigation display to your aircraft: trying to clean up a few thigns here...)
m (→‎Development: this still needs more wiki markup to look "good")
Line 238: Line 238:


To get started, just copy the whole 747-400 section in NDStyles and rename it to match your needs. Once that is working (getting a 747-400 ND via the 777-200 identifier), you can simply replace the SVG file name and add your own update handlers to incrementally come up with your own ND.
To get started, just copy the whole 747-400 section in NDStyles and rename it to match your needs. Once that is working (getting a 747-400 ND via the 777-200 identifier), you can simply replace the SVG file name and add your own update handlers to incrementally come up with your own ND.
== Step by Step ==
{{Note|The following section is currently work-in-progress, it is being written by 5H1N0B1 and drdavid, please get in touch to help reviewing/improving things.}}
More detailed instruction. See if it could help.
# Have an updated version of FlightGear (V. 3.0+).
# Set up the 3D model in this way:
To create a 3D MFD ->
* Select a 3D Border (border of the screen, with screws, etc.)
* Need to have a 3D Button/switch, molette, or turnable knob
* A 3D Screen object, with:
** correct dimensions
** Single texture, -> with correct dimensions
** Correct dimension of the UVmap
# Copy and paste the ND.nas file to the appropriate folder (In the Mirage 2000 this was the "Center-mfd" folder).
# Add the ND.nas pathway to your base .xml file in the Nasal block.
# Edit ND.nas :
* Rename the screen to match the object in 1)c) if needed.
* If installing a single MFD, you do not need another object, so suppress the line (when it's calling the object itself)
* Keep the property's name -> it's ok. You just need to input it with the .xml button in 1)b)
# Code the xml itself.
Really simple, it's just playing with properties. For example, see this for the airport property:
<syntaxhighlight lang="xml">
  <!--######################## Airports ############################-->
  <animation>
    <type>pick</type>
    <object-name>bt-h1</object-name>
    <visible>true</visible>
    <action>
        <button>0</button>
        <binding>
        <command>property-toggle</command>
        <property>/instrumentation/efis/inputs/arpt</property>
        </binding>
    </action>
  </animation>
</syntaxhighlight>
Or here again for the range selection:
<syntaxhighlight lang="xml">
  <animation>
    <type>pick</type>
    <object-name>trim1</object-name>
    <action>
      <button>4</button>
      <!--  scroll up -->
      <repeatable>false</repeatable> 
      <binding>
                <command>property-cycle</command>
                <property>/instrumentation/efis/inputs/range-nm</property>
                <value>10</value>
                <value>20</value>
                <value>40</value>
                <value>80</value>
                <value>160</value>
                <value>320</value>
      </binding> 
    </action>
  </animation>
  <animation>
    <type>pick</type>
    <object-name>trim1</object-name>
    <action>
      <button>3</button>
      <!--  scroll up -->
      <repeatable>false</repeatable>
 
      <binding>
                <command>property-cycle</command>
                <property>/instrumentation/efis/inputs/range-nm</property>
                <value>320</value>
                <value>160</value>
                <value>80</value>
                <value>40</value>
                <value>20</value>
                <value>10</value>             
      </binding> 
    </action>
  </animation>
</syntaxhighlight>
Next, you can optionally add this:
<syntaxhighlight lang="xml">
  <animation>
  <type>pick</type>
  <object-name>blackbkd</object-name>
  <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>nasal</command>
        <script>mirage2000.showNd();</script>
      </binding>
  </action>
  </animation>
</syntaxhighlight>
Where 'blackbkd' is the screen 1)c). This last option allows you to open a dialog box with what the actual canvas should display in your 1)c) screen. This is very useful to check all the different steps when something isn't working well.
Normally following these steps, you should have a working MFD.


== Development ==
== Development ==

Navigation menu