Board index FlightGear Development Aircraft Cockpit development

format of osg display

Discussion about creating 2d and 3d cockpits.

format of osg display

Postby gkick » Tue Jun 27, 2017 5:42 pm

To display a property value on screen doing a shift click in the property box will result in a display like

wind-from-heading-deg = 150.034691323 (in a nice crisp white font)

nasal osg script will look the same
right.add("/enviroment/wnid-from-heading-deg");
</script>
</OSD>
Now the question is- what is the syntax to display the same data with the same font and colour like this: (not using a hud)

Wind Heading: 150 degrees

Thanks for your thoughts
gkick
 
Posts: 106
Joined: Sun Jan 01, 2017 11:04 pm

Re: format of osg display

Postby Octal450 » Tue Jun 27, 2017 7:44 pm

Do you mean for OSGtext?
You can do this:
Code: Select all
   <text>
      <name>wingheading</name>
      <offsets>
         <x-m>-0.001</x-m>
         <y-m>0.0</y-m>
         <z-m>0.083</z-m>
      </offsets>
      <alignment>center-center</alignment>
      <axis-alignment>yz-plane</axis-alignment>
      <type type="string">text-value</type>
      <format type="string">Wind Heading: %s Degrees</format>
      <truncate type="bool">false</truncate>
      <font type="string">helvetica_medium.txf</font>
      <property>/enviroment/wnid-from-heading-deg</property>
      <draw-text type="bool">true</draw-text>
      <draw-alignment type="bool">false</draw-alignment>
      <draw-boundingbox type="bool">false</draw-boundingbox>
      <character-size>0.0050</character-size>
      <font-resolution>
         <width type="int">64</width>
         <height type="int">64</height>
      </font-resolution>
   </text>
    <animation>
        <type>material</type>
      <object-name>windheading</object-name>
        <diffuse>
            <red>1</red>
            <green>1</green>
            <blue>1</blue>
        </diffuse>
        <ambient>
            <red>0</red>
            <green>0</green>
            <blue>0</blue>
        </ambient>
        <specular>
            <red>0</red>
            <green>0</green>
            <blue>0</blue>
        </specular>
        <emission>
            <red>1</red>
            <green>1</green>
            <blue>1</blue>
        </emission>
    </animation>



Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 1 guest