Function DrawMap

From Uzebox Wiki
Jump to: navigation, search
Prototype

void DrawMap(unsigned char x,unsigned char y,const int *map);

Description

Draws a rectangular map pointed to by *map at the specified coordinates. Maps are int or char arrays (depending on the active video mode) in which the two first elements respectively specifies the width and height of the map. This function expects the data to be located in flash (PROGMEM).

Parameters
  • x: Position from left of screen
  • y: Position from top of screen
  • map: Pointer to int/char array in PROGMEM.
Returns

Void

Video Modes

1

Since

V1

Notes

This function is for use with word oriented VRAM video modes (Mode 1). For byte oriented modes (2,3) use DrawMap2().

Example:

const char my_map[] PROGMEM ={2,3, 0x02,0xcc, 0x03,0x02, 0x23,0x54}; //you would usually put map data in import files
#include "data/my_tiles.inc";
 
int main(void){
  SetTileTable(my_tiles);
  ClearVram();
   
  DrawMap(10,10,my_map);
   
  while(1);
}