📄 mapwin.htm
字号:
<p>
<strong>Mousebuttons</strong>. You can define which action
each button performs. Drag map allows you to scroll the map
by holding the button and dragging the mouse over the Map Editor
window. Placer.lua runs the Placer.lua script in the luascr folder.
<br><br>
<strong>Lua scripts</strong>. Newly added in 1.3.22, you can write scripts to perform
functions in the editor such as exporting/importing graphics, maps
and other data from custom formats, performing a custom task and
many other things. The scripts are written in a language called LUA
(see www.lua.org), see the copyright notice in the luascr folder.
The scripts must be put in the luascr folder, and you need to set
the LUA values in the mapwin.ini file to add them to the Custom menu.
Alternatively, you can drag and drop a file ending with '.lua'
onto MappyWin32 to run it.<br><br>
I have included some example scripts in the luascr folder, look
at them in a text editor
to see how they work, I am a novice with Lua, so they are quite
basic. Load a test map and run them to see what they do, most of them
give a brief summary of what they so before they start.
You do not need to restart Mappy if you modify a script.
MappyWin32 extends LUA with these functions (don't forget
to prefix functions and values with 'mappy.' see the .lua files in
the luascr folder):<br><br>
getValue (VALUE_ID)<br>
where VALUE_ID is one of:<br>
MAPWIDTH,
MAPHEIGHT,
BLOCKDEPTH,
BLOCKWIDTH,
BLOCKHEIGHT,
NUMBLOCKSTR,
NUMBLOCKGFX,
BLOCKGAPX,
BLOCKGAPY,
BLOCKSTAGGERX,
BLOCKSTAGGERY,
CLICKMASK,
TRANS8,
TRANSRED,
TRANSGREEN,
TRANSBLUE,
CURLAYER,
CURBLOCK,
CURANIM,
CURBRUSH,
MOUSEBLOCKX,
MOUSEBLOCKY,
GETBLOCKMODE,
PALETTEARGB+index<br><br>
setValue (VALUE_ID, SETVALUE)<br>
where VALUE_ID is one of:<br>
TRANS8,
TRANSRED,
TRANSGREEN,
TRANSBLUE,
PALETTEARGB+index<br><br>
getBlock (X, Y [,L])<br>
where X is the x coord in blocks,
and Y is y coord in blocks, L is the optional layer number, omit it for current layer<br><br>
setBlock (X, Y, B [,L])<br>
where X is the x coord in blocks, and Y is y coord in blocks, and B is the block index,
L is the optional layer number, omit it for current layer (see 'Solid rectangle.lua' for an example)<br><br>
getBlockValue (B, VALUE_ID)<br>
where B is the block index, and VALUE_ID is one of:<br>
BLKBG,
BLKFG1,
BLKFG2,
BLKFG3,
BLKUSER1,
BLKUSER2,
BLKUSER3,
BLKUSER4,
BLKUSER5,
BLKUSER6,
BLKUSER7,
BLKFLAG1,
BLKFLAG2,
BLKFLAG3,
BLKFLAG4,
BLKFLAG5,
BLKFLAG6,
BLKFLAG7,
BLKFLAG8<br><br>
setBlockValue (B, VALUE_ID, VALUE)<br>
where B is the block index, and VALUE_ID is one of:<br>
BLKBG,
BLKFG1,
BLKFG2,
BLKFG3,
BLKUSER1,
BLKUSER2,
BLKUSER3,
BLKUSER4,
BLKUSER5,
BLKUSER6,
BLKUSER7,
BLKFLAG1,
BLKFLAG2,
BLKFLAG3,
BLKFLAG4,
BLKFLAG5,
BLKFLAG6,
BLKFLAG7,
BLKFLAG8<br>
and VALUE is the value to write (flags are 0 or 1) see 'Tile graphic test.lua'<br><br>
copyLayer (SOURCE, DEST)<br>
where SOURCE is the layer to copy from (0 to 7 or MPY_UNDO), and DEST is the
layer to copy to (0 to 7 or MPY_UNDO) if you are changing the current layer, use:<br>
mappy.copyLayer(mappy.getValue(mappy.CURLAYER),mappy.MPY_UNDO)<br>
to enable undo.
<br><br>
updateScreen ()<br>
call this to refresh the display after altering a layer<br><br>
createBlock (B)<br>
where B is the block index to insert the new block at<br><br>
deleteBlock (B)<br>
where B is the block index to remove<br><br>
createGraphic (G)<br>
where G is the graphic index to insert the new graphic at<br><br>
deleteGraphic (G)<br>
where G is the graphic index to remove<br><br>
In the following A is Alpha, R is Red, G is Green, B is Blue, all values between
0 (none) and 255 (max), 0 Alpha is transparent, 255 is solid.<br>
A,R,G,B = getPixel (X, Y, G)<br>
where X, Y is pixel coord within the graphic, G is the graphic index<br><br>
setPixel (X, Y, G, A, R, G, B) or<br>
setPixel (X, Y, G, INDEX)<br>
where INDEX is the palette index 0 to 255)<br><br>
R = msgBox ("TITLE", "MESSAGE", TYPE, ICON)<br>
where TYPE is one of:<br>
MMB_OK,
MMB_OKCANCEL,
MMB_YESNOCANCEL,<br>
and ICON is one of:<br>
MMB_ICONNONE,
MMB_ICONINFO,
MMB_ICONQUESTION,
MMB_ICONEXCLAMATION<br>
returns one of:<br>
MMB_CANCEL,
MMB_YES,
MMB_NO<br><br>
R, "FILENAME" = fileRequester ("PATH", "DESCRIPTION", "EXTENSION", TYPE)<br>
where PATH is the starting folder (try "."), DESCRIPTION is what
appears in the 'Save as type' box, EXTENSION is a properly formatted mask
for file extensions (ie: "*.FMP" or "*.FMP;*.MAP"). And TYPE is either
MMB_OPEN or MMB_SAVE<br>
returns R, either MMB_OK or MMB_CANCEL, also "FILENAME"<br><br>
R = doDialogue ("TITLE", "MESSAGE", "STRING", TYPE)<br>
where TYPE is either MMB_DIALOGUE1 or MMB_DIALOGUE2, type 1 returns
MMB_OK or MMB_CANCEL and one string, type 2 returns MMB_OK or MMB_CANCEL
and as many strings as there were commas plus 1 (ie: hello,1,2,3 would
return four strings "hello" "1" "2" and "3")<br><br>
R = shiftVal (VALUE, SHIFT) negative shift is left, positive is right<br>
R = andVal (VALUE1, VALUE2)<br>
R = orVal (VALUE1, VALUE2)<br>
<p><a href="#topod">(top of doc)</a> </p>
<hr>
<p><a name="scuts"></a></p>
<h3>Shortcuts</h3>
<p> This is a list of shortcut keys, excluding those listed next
to items in the menus (see the menus for these):<br><br>
f = fill area with current block/brush (from mousepointer)<br>
ctrl+f = fill area with current brush randomly (from mousepointer)<br>
l = draw a line from last placed block to mousepointer (8 directions)<br>
o = toggle picklayer (isometric)<br>
p = pick (select) current block/anim from under mouse pointer<br>
, = (comma) select previous numbered block/anim<br>
. = (fullstop) select next numbered block/anim<br>
cursor keys = scroll map<br><br>
You can also set the function keys and number keys (main keyboard)
to any function you want, you will need to change the values in the
<a href="#mapini">mapwin.ini</a> file to any of these values (so keyF2=400
will run the first lua script in the custom menu when F2 is pressed,
keyF3=124 will change to layer 1 when F3 is pressed etc):<br><br>
<br>
LUA01 400,
LUA02 401,
LUA03 402,
LUA04 403,
LUA05 404,
LUA06 405,
LUA07 406,
LUA08 407,
LUA09 408,
LUA10 409,
LUA11 410,
LUA12 411,
LUA13 412,
LUA14 413,
LUA15 414,
LUA16 415,
TOOLSAVENOGFX 177,
FILEEXPORTTEXT 176,
CUSTOMBUTTONS 175,
TOOLIMPORTBIG 174,
TOOLUSERINFO 173,
LAYERDUPLICATE 172,
TOOLFLIPTILES 171,
TOOLZOOM025 170,
TOOLZOOM05 169,
TOOLRESIZETILES 168,
TOOLAUTOBG 167,
TOOLLINE 166,
BRUSHGRABNEW 165,
LAYERADJUSTVALUES 164,
LAYERREMOVEMARKERS 163,
BRUSHHANDLEBR 162,
BRUSHHANDLEBL 161,
BRUSHHANDLETR 160,
BRUSHHANDLETL 159,
TOOL16X16TO8X8 158,
LAYERSLIDE 156,
PICKLAYER 155,
TOOLPILLARS 154,
TOOLREVEAL 153,
FILEIMPORTALT 152,
BRUSHRENAME 151,
BRUSHGRABBS 150,
BRUSHGRABNT 149,
TOOLRANGE 148,
LAYERCLEAR 137,
LAYERONION 147,
TOOLZOOM4 146,
TOOLZOOM2 145,
TOOLZOOM1 144,
TOOLREMOVEUNUSED 141,
BRUSHDESTROY 140,
TOOLANIMSETUP 139,
TOOLANIMPREVIEW 138,
EDITUNDO 135,
TOOLFILLRANDOM 210,
TOOLFILL 209,
TOOLINFO 134,
TOOLGRID 208,
FILEEXPORT 133,
TOOLRESIZE 132,
LAYER7 130,
LAYER6 129,
LAYER5 128,
LAYER4 127,
LAYER3 126,
LAYER2 125,
LAYER1 124,
LAYER0 123,
LAYERDELETE 122,
LAYERADD 121,
PICKBLOCK 207,
BLOCKNEXT 206,
BLOCKPREV 205,
ARROWRIGHT 203,
ARROWLEFT 202,
ARROWDOWN 201,
ARROWUP 200,
HELPABOUT 120,
HELPCONTENTS 119,
BRUSH16 315,
BRUSH15 314,
BRUSH14 313,
BRUSH13 312,
BRUSH12 311,
BRUSH11 310,
BRUSH10 309,
BRUSH9 308,
BRUSH8 307,
BRUSH7 306,
BRUSH6 305,
BRUSH5 304,
BRUSH4 303,
BRUSH3 302,
BRUSH2 301,
BRUSH1 300,
BRUSHGRAB 110,
EDITPASTE 109,
EDITCOPY 108,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -