OSD

From Navit's Wiki
Revision as of 16:32, 16 December 2008 by Niccolo (talk | contribs)
Jump to: navigation, search

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.

Exemple:

Navit-internal-osd-fon.png