Difference between revisions of "OSD"

From Navit's Wiki
Jump to: navigation, search
Line 12: Line 12:
 
Example [[Configuring_NavIt#A_deeper_look_at_the_XML_file|navit.xml]] contents:
 
Example [[Configuring_NavIt#A_deeper_look_at_the_XML_file|navit.xml]] contents:
  
    <osd type="button" x="0" y="0" command="zoom_in" src="osd_plus.png" />
+
<osd type="button" x="48" y="336" command="zoom_in" src="zoom_in.xpm" />
    <osd type="button" x="0" y="32" command="zoom_out" src="osd_minus.png" />
+
<osd type="button" x="48" y="96" command="zoom_out" src="zoom_out.xpm" />
  
 
You will need to provide your own osd_plus.png and osd_minus.png to use this example (they are not in navit svn yet). 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.
 
You will need to provide your own osd_plus.png and osd_minus.png to use this example (they are not in navit svn yet). 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.

Revision as of 20:25, 21 August 2008

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="336" command="zoom_in" src="zoom_in.xpm" /> <osd type="button" x="48" y="96" command="zoom_out" src="zoom_out.xpm" />

You will need to provide your own osd_plus.png and osd_minus.png to use this example (they are not in navit svn yet). 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.

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.