All Functions Modules Pages
maps

Functions

MAP map.new (IMAGE tileset, TABLE mapData, NUMBER TileX, NUMBER TileY)
 Cretes a map. More...
 
NIL map.blit (MAP map, NUMBER x, NUMBER y)
 Blits a map. More...
 
NUMBER map.sizex (MAP map)
 It returns a map width. More...
 
NUMBER map.sizey (MAP map)
 It returns a map height. More...
 
NIL map.set (MAP map, NUMBER tilex, NUMBER tiley, NUMBER value)
 Sets the desired tile in a specific position. More...
 

Detailed Description

Uso de mapas.

Function Documentation

MAP map.new ( IMAGE  tileset,
TABLE  mapData,
NUMBER  TileX,
NUMBER  TileY 
)

Cretes a map.

Parameters
tilesetPath to a previously loaded tileset (png or jpg, max size = 512x512 pixels).
mapDataArray containing map data.
TileXTile width in pixels.
TileYTile height in pixels.
Note
It is recommended: GBA graphics by brunni, to generate maps.
Tileset must be an image with these width sizes in pixels: 8,16,32,64,128,256,512.
Returns
a "map" type object, ready to use.
NIL map.blit ( MAP  map,
NUMBER  x,
NUMBER  y 
)

Blits a map.

Parameters
map"map" type object.
xHorizontal map position.
yVertical map position.
Returns
Nothing.
NUMBER map.sizex ( MAP  map)

It returns a map width.

Parameters
mapA map type object.
Returns
Map width.
NUMBER map.sizey ( MAP  map)

It returns a map height.

Parameters
mapA map type object.
Returns
Map Height.
NIL map.set ( MAP  map,
NUMBER  tilex,
NUMBER  tiley,
NUMBER  value 
)

Sets the desired tile in a specific position.

Parameters
mapA map type object.
tilexPosition of the tile x.
tileyPosition of the tile y.
valuenumber to be drawn at that position.
Returns
Nothing.