Difference between revisions of "OSD"

From Navit's Wiki
Jump to: navigation, search
Line 24: Line 24:
 
The OSD layer is still under development.
 
The OSD layer is still under development.
  
Exemple:
+
Example:
 +
1.
 +
[[Image:Navit-internal-osd-fon.png|500px]]
 +
2. Not finished yet but quite clean
 +
[[Image:Mineque_OSD_Layout_wip.jpg|500px]]
  
[[Image:Navit-internal-osd-fon.png|500px]]
+
      <osd enabled="no" type="compass"background_color="#1568a200" />
 +
      <osd enabled="yes" type="text" background_color="#00000080" font_size="300" text_color="#da1b1b" label="Currently On ${navigation.item.street_name}  {navigation.item[1].street_name_systematic}" x="5" y="0" h="30" w="720" />
 +
      <osd enabled="yes" type="text" background_color="#00000080" font_size="300" label="${vehicle.position_sats_signal} | ${vehicle.position_qual}" x="725" y="0" w="65" h="30" />
 +
     
 +
      <osd enabled="yes" type="text" label="ETA:${navigation.item.destination_time[arrival]}" background_color="#00000099" font_size="350" x="-790" y="-25" w="160" h="25" />
 +
      <osd enabled="yes" type="text" label="TL:${navigation.item.destination_time[remaining]}" background_color="#00000099" font_size="350" x="-630" y="-25" w="160" h="25"/>
 +
      <osd enabled="yes" type="text" label="Dist:${navigation.item.destination_length[named]}" background_color="#00000099" font_size="350" x="-470" y="-25" h="25" w="170" />
 +
      <osd enabled="yes" type="text" label="${vehicle.position_speed} / ${tracking.item.route_speed}" background_color="#00000099" font_size="280"  x="-300" y="-25" h="25" w="150" />
 +
      <osd enabled="yes" type="navigation_next_turn" x="-150" y="-80"  w="150" h="50"/>
 +
     
 +
      <osd enabled="no" type="button" x="0" y="-300" command="gui_internal_fullscreen" src="toggle_fullscreen.xpm"/>
 +
      <osd enabled="no" type="button" x="-10" y="0" command="gui_internal_menu" src="menu.xpm"/>
 +
      <osd enabled="no" type="button" x="-30" y="35" command="zoom_in" src="zoom_in.xpm"/>
 +
      <osd enabled="no" type="button" x="10" y="35" command="zoom_out" src="zoom_out.xpm"/>

Revision as of 04:12, 3 February 2009

The On Screen Display (OSD) provides status information and controls blended directly onto the map.

Current (2008-06-21 svn) OSD types:

  • compass
  • eta
  • navigation
  • street_name
  • button

The button type can be used to provide zoom in/zoom out functionality with gui_internal (which does not itself draw any controls onto the map view). Example navit.xml contents:

   <osd type="button" x="48" y="48" command="gui_internal_fullscreen" src="toggle_fullscreen.xpm" />
   <osd type="button" x="-96" y="48" command="gui_internal_menu" src="menu.xpm" />
   <osd type="button" x="-96" y="-96" command="zoom_in" src="zoom_in.xpm" />
   <osd type="button" x="48" y="-96" command="zoom_out" src="zoom_out.xpm" />

The x and y coordinates depend on your screen resolution and the size of your bitmaps. The origin is at the upper lefthand corner of the screen. Use negative values to position the buttons relative to the right resp. bottom edge of the screen. Besides zoom, the commands include gui_internal_menu and gui_internal_fullscreen.

You can determine the supported xml options for each OSD type by reading navit/osd/core/osd_core.c, searching for "attr_xxx" inside the osd_xxx_new() functions. Most types have at least an "x" and "y" option that determine the location of their OSD.

The OSD layer is still under development.

Example: 1. Navit-internal-osd-fon.png 2. Not finished yet but quite clean Mineque OSD Layout wip.jpg

      <osd enabled="no" type="compass"background_color="#1568a200" />
      <osd enabled="yes" type="text" background_color="#00000080" font_size="300" text_color="#da1b1b" label="Currently On ${navigation.item.street_name}  {navigation.item[1].street_name_systematic}" x="5" y="0" h="30" w="720" />
      <osd enabled="yes" type="text" background_color="#00000080" font_size="300" label="${vehicle.position_sats_signal} | ${vehicle.position_qual}" x="725" y="0" w="65" h="30" />
      
      <osd enabled="yes" type="text" label="ETA:${navigation.item.destination_time[arrival]}" background_color="#00000099" font_size="350" x="-790" y="-25" w="160" h="25" />
      <osd enabled="yes" type="text" label="TL:${navigation.item.destination_time[remaining]}" background_color="#00000099" font_size="350" x="-630" y="-25" w="160" h="25"/>
      <osd enabled="yes" type="text" label="Dist:${navigation.item.destination_length[named]}" background_color="#00000099" font_size="350" x="-470" y="-25" h="25" w="170" />
      <osd enabled="yes" type="text" label="${vehicle.position_speed} / ${tracking.item.route_speed}" background_color="#00000099" font_size="280"  x="-300" y="-25" h="25" w="150" />
      <osd enabled="yes" type="navigation_next_turn" x="-150" y="-80"  w="150" h="50"/> 
      
      <osd enabled="no" type="button" x="0" y="-300" command="gui_internal_fullscreen" src="toggle_fullscreen.xpm"/> 
      <osd enabled="no" type="button" x="-10" y="0" command="gui_internal_menu" src="menu.xpm"/>
      <osd enabled="no" type="button" x="-30" y="35" command="zoom_in" src="zoom_in.xpm"/>
      <osd enabled="no" type="button" x="10" y="35" command="zoom_out" src="zoom_out.xpm"/>