Function DrawMap

From Uzebox Wiki
Jump to navigation Jump to search
Prototype

void DrawMap(unsigned char x,unsigned char y,const VRAM_PTR_TYPE *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, 2, 3

Since

V1

Notes

This function is for use with word and byte oriented VRAM video modes (Modes 1, 2, and 3).

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);
}