1 (edited by liverol 2009-03-17 19:50:23)

Topic: mappy function parameters,please help

hi gman,thanks for all the nice work,
i am writting a small game which using mappy map,and i am coufused about
some functions,
can you give some details for this functions:

MapDrawFG(scrlx, scrly, 0, 0, scrnw, scrnh, 0),
what does the last parameter mean? layer or what?

any functions to get the map layer number ?
i want to use a for next loop to draw/check all the layer,
it's not so handy to switch the current layer all the time.

also please give some detail for type BLKSTR,what do the fields mean like bg/fg/user0..?

thanks for reply!

Re: mappy function parameters,please help

greetings smile  my sincere apologies on the delay.  work is keeping me a bit busy of late.

im definately no expert on mappy.  your best resource would be the manual that comes with the mappy program.

MapDrawFG(scrlx, scrly, 0, 0, scrnw, scrnh, 0),
what does the last parameter mean? layer or what?

i believe it stands for block layer.  each block can have multiple layers so you can build things like pillars.  how these layers are used depends on your map type.  see the manual for details.  these are the bg, fg, fg2, fg3 block properties.  also, this is not the same as map layer.

any functions to get the map layer number ?
i want to use a for next loop to draw/check all the layer,
it's not so handy to switch the current layer all the time.

the mapcurlyr layer property of your map (as you know) is your access to switching layers around.  the entire class is built around this so i dont believe without a major rewrite there would be a way to change that.  still there is a mapmaxlayers property that is set when you load the map (default is 2).  you can use this to for loop through draw and collision tests.

for local layer:Int = 0 until map.maxmaplayers
   map.mapcurlyr = layer
   map.MapDrawFG(scrlx, scrly, 0, 0, scrnw, scrnh, 0)
next

also please give some detail for type BLKSTR

the fields directly correlate with the block properties in the mappy editor.  load a map and double-click on of the still blocks on the right.  what the values are used for depend on you and the map you are building.  see the manual for more.