drawMapLayer()
Purpose
Draw a tile map layer
Description
Draw a tile map layer previously loaded with loadmap
Syntax
drawMapLayer( layer )
Arguments
layer layer number of the map to draw (zero based)
Example
// To view this map demo, please load the project "Map Commands Demo" from FUZE Programs.
// Maps must be stored in the project you wish to load them into.
maps = [
"map1",
"map2"
]
m = 0
layer = false
press = [
.a = false,
.up = false
]
loadMap( maps[m] )
setSpriteCamera( 0, 0, 2 )
loop
centerSpriteCamera( 0, 0 )
clear()
c = controls( 0 )
if !c.a then
press.a = false
endIf
if !c.up then
press.up = false
endIf
drawMapLayer( 0 )
if layer then
drawMapLayer( 1 )
endIf
if c.up and !press.up then
press.up = true
layer = !layer
endIf
if c.a and !press.a then
press.a = true
unloadMap()
m += 1
if m >= 2 then
m = 0
endIf
loadMap( maps[m] )
endIf
printAt( 0, 0, "Press A button to swap between maps" )
printAt( 0, 2, "Currently viewing: " + maps[m] )
printAt( 0, 4, "Press Up directional button to toggle additional layers" )
update()
repeat
Associated Commands
collideMap(), drawMap(), getMapArea(), getMapAreaNames(), getMapLocation(), getMapLocationNames(), loadMap(), unloadMap(), updateMap()