📄 mapwin.htm
字号:
<a href="#imgfmts">supported image formats</a> for more information.
The tile graphic picture should be black (index 0 in 8bit, RGB=000000 in
truecolour) where
there are no tiles. Make sure the picture is big enough for all
the tiles you want. If you need to expand the picture later add
the extra space to the bottom (most paint packages let you do this).
If you update or add more tiles to the picture you can re-import
it and the old tiles will be updated and the new tiles will be added.<br><br>
Start MappyWin32 and select 'New Map' from the File menu (ctrl+m).
Fill in the tile dimensions in pixels (first two boxes), and the
map dimensions in blocks (tiles). You can resize later if you need to.
For TEST.BMP the tiles are 16 pixels wide by 16 pixels high. You can
make the map whatever size you want, (for this tutorial choose 100 wide
by 100 high, which will give a map 1600 pixels wide by 1600 pixels high).
The size in pixels is
mapwidth*tilewidth by mapheight*tileheight. Now select the colour depth
of the map, (select truecolour unless you know you need to use 8bit)
then click 'OK'. You will see a messagebox telling you to import some
graphics, so click 'OK' and select Import from the File menu (or press
ctrl+i). Doubleclick your image file (TEST.BMP is in the docs/images folder)
and you should see your tiles loaded. For TEST.BMP the colourkey is
black, so choose 'Map Properties' from the MapTools menu and change
the 24bit colourkey from FF00FF to 000000 this is worth doing even
with 8bit maps as this will be used if you load it in a truecolour
mode. You can also select 'Autoset BG transparency' from the 'Useful
Functions' option in the MapTools menu, any tiles with the transparent
colour in them now have the 'BG transparency' flag set (more on this
later).<br><br>
To save the map in FMP format, select 'Save As' from the File
Menu and type a name for the new map (.FMP will be added if you don't
type it).<br><br>
If you have modified your original graphics file and want to
update the tiles in the map, use 'Import' again from the File menu.
<br><br>
<strong>Tutorial 3: Autofringing and laying paths</strong><br>
Autofringing lets you draw areas on the map with a block,
then select 'Autofringe' from the Custom menu to smooth out the
joins between that area and the rest of the map. An example of
this is putting islands on an ocean. To do this, you will need
12 fringe blocks in the Block editor window after the block you
were drawing the area with. They need to be in this order:<br>
<br>
<center><img src="images/fringe.png" alt="Fringe order"></center><br>
<br>
Laying a path is done by having 6 blocks (left/right, up/down,
then the corners) in this order:<br>
<br>
<center><img src="images/laypath.png" alt="Lay path order"></center><br>
<br>
Select the first (left/right) block, then set a mousebutton (in
Custom menu) to 'Lay path'. Keep the mousebutton pressed while
you move the mouse over the map to lay the path, it may take a
couple of blocks to start.
The path will look best if you move between adjacent blocks, not
diagonally. Lay path is also useful for things like rivers, walls,
hedges and more.<br>
<br>
<strong>Tutorial 4: Preparing a final FMP map</strong><br>
FMP maps are ready to use from the first time they are saved.
Use a <a href="#playlib">playback library</a> to load and use FMP
maps in a game project. To reduce the size and memory use of a FMP
file you should make sure you have saved the FMP file, then select
'Remove unused or duplicate' from the MapTools menu. You can see the
difference in 'Map Properties'. Now save the map, but don't
overwrite the original (you should keep that for updating the map).
If the FMP size still seems large, it should reduce down
when you compress it in a zip file or similar.
</p>
<p><a href="#topod">(top of doc)</a> </p>
<hr>
<p><a name="maped"></a></p>
<h3>The Map Editor Window</h3>
<p> This will show how the map is layed out, and allow you
to edit that layout. Simply select a block, anim, or brush and
paint with it by clicking the left mouse button on the square
where you want to place the tile, you can alter more than one
square by holding down the left mouse button and moving the
mouse. The actions performed by the mousebuttons can be defined
by selectin 'Mousebuttons' in the Custom menu. The mousewheel
can be used to scroll the blocks in the Block editor window.
You can fill an area of blocks with either a still
block, anim block or brush (depending on what is currently
selected as your drawing item) by pressing the 'f' key (make sure
caps lock isn't on) when the mouse button is over the block you
want to start the fill with. You can also fill randomly from a
brush with Ctrl+F, you can weight blocks by having more than one
in a brush (try and see, you can undo a fill with Undo, Ctrl+Z).
Another handy shortcut is to press the 'p' key while the mouse
pointer is over the block you want to pick in the Map Editor
window, this will now be your current block/anim. You can select
the next/previous block/anim by pressing the ',' and '.' keys.<br>
<br>
You can move the area seen in the Map Editor window by
either using the scrollbars on the right and bottom edges of that
window, or by pressing the arrow (cursor) keys, hold them down to
scroll along. When you get to the right or bottom edges of the
map you will see a grey area which cannot be modified.<br>
<br>
Information about the block under the mouse pointer is
given in the window title bar.</p>
<p><a href="#topod">(top of doc)</a> </p>
<hr>
<p><a name="blocked"></a></p>
<h3>The Block Editor Window</h3>
<p> This shows all the still and animated blocks that have
been created, you can toggle between the still and animated
screens by right clicking the mouse over the Block Editor window.
To select a block or anim, left click the mouse button on it, you
can now draw with it in the Map Editor window.
You can add a new block/anim, cut copy and paste
(all in the Edit menu), new and paste put the block after the
currently selected one. Each block takes only 32 bytes of space
(see Map Properties). Note that cutting a block will remove any
references to it from the map array (they will be replaced with a
reference to block 0), and pasting it will not put them back, so
it's usually best not to cut blocks you are using in the map
array. Also note that cutting a block does not remove the
graphics it was using. Using new, cut, copy and paste does not
affect the graphics you imported in any way, click on the picture
above 'BG' in a block's properties to see the actual graphics.
As long as you don't use 'Remove unused or duplicate graphics'
options the graphics will never change, allowing you to update
them from the original imported image.
Undo does not work when editing the Block
Editor.<br>
<br>
You can see more blocks/anims by scrolling up and down
with the scrollbar on the right of the Block Editor window.<br>
<br>
To edit a block structure, double click it in the Block
Editor window. Depending on whether it is a still or animated
block, you will be shown a dialogue giving details about it and
allowing you to change it.<br>
<br>
<strong>Editing Properties of a Still Block</strong>. You will be shown the
block you double clicked, along with it's properties. The numeric
information is not used by Mappy and is entirely for your own
use, as are the four collision detection, and 'other' bits. The BG
transparency box indicates whether BG transparency is taken into
account (you will nearly always check that in block 0 if you plan
to use transparency, as well as any blocks that have a
transparent colour in the BG graphic. An easy way to set this for
all blocks with some transparent pixels is to select 'Auto set
BG transparency' from the 'Useful functions' option in the MapTools
menu after you have imported your graphics). In the bottom left, you will see the
four layers of graphics that make up the block's appearance,
simply click them to pick a new graphic, BG is used as the back
layer, you will probably only want to use the first FG layer,
this allows you to draw the map in layers in the playback
libraries, sandwiching sprites between them to give depth. You
can go to the next/previous block by clicking the arrows next to
the OK button. TextStrings are covered in the
<a href="#textstr">TextStrings and Labels</a> section.<br>
<center><img src="images/blprop.png" alt="Block Properties diagram"></center>
<br>
<strong>Editing Properties of an Animated Block</strong>. Double clicking
an animated block in the Block Editor window lets you create
animations. Animated blocks are made up of a sequence of still
blocks, you do not pick graphics when you edit them, but still
block structures. The reference block is how the anim appears
when it is not animating (such as in the Block and Map Editor
windows), click it to change. Below that is the sequence of still
blocks, there is a black and white 'C' shape indicating where
frames will be inserted and deleted, simply click where you want
to insert or cut, then click the Insert or Cut buttons. Clicking
Insert will take you to another dialogue where you can pick up to
30 frames to insert (you can have more than 30 frames in an
animation, just click insert again). When you OK, you are
returned and the new frames will be shown, with the edit point
'C' cursor at the end of the new frames. The Delay is the number
of calls to UpdateAnims before the next frame is used, so the
higher it is the slower it will animate, the actual speed is
determined by how often you call UpdateAnims (a playback library
function), you can get a rough idea with Anim Preview from the
MapTools menu. To the right of Delay is the style of animation,
click to change, LOOPF continually loops forward, ONCE only plays
the anim once (this is so your game can trigger an event), PP
pingpongs between the start and end frame via the middle ones.</p>
<p><a href="#topod">(top of doc)</a> </p>
<hr>
<p><a name="filemenu"></a></p>
<h3>The File Menu</h3>
<p> This has the standard file features such as Open (open
a .FMP or .MAP mapfile for editing), Save (saves current .FMP or .MAP file under
it's current name, if it hasn't been named this is the same as
Save As), Save As (requests a name to save the map, .FMP will be
added if you don't type it in then saves it), Exit (quits Mappy,
same as clicking the 'X' gadget in the window titlebar, you
will be warned if you have modified a map but not saved it), and
some Mappy specfic ones, which are:<br><br>
<strong>New Map</strong>. Brings up the new map dialogue where you choose
settings for the new map, you should have carefully decided on
the values you enter here. Either the default values will be shown, or
the values for the currently loaded map (currently loaded map
will be cleared from memory if you OK from New Map), you can
modify these values to any legal value. If you are creating a
map with non-rectangular tiles click 'Advanced'.
Note: Your Windows desktop doesn't need to be in, or support,
that depth, your Windows desktop does need to be in high or true
colour though (yes, even for 8bit maps :).<br>
<strong>Advanced dialogue:</strong>
FMP version: this allows you to specify the version
of the FMP file, you can change it in Map Properties later on.<br>
Block gap x and y: this is the gap between blocks, if x is the same width,
the blocks will be next to each other. For isometric maps,
gapx should be the same as blockwidth, and
gapy should be the same as blockheight.<br>
Block stagger x and y: This is the offset for every other row, for
isometric, stagger x should be half blockwidth, stagger y should be half
blockheight. You can change all these in Map Properties later on if it doesn't look right.<br>
<br>
When you 'OK' you will be given a map
filled with one block (shown in the Block Editor 'still' window)
this is a special block, you can edit it's properties (by double
clicking) but not give it any graphics or delete or move it from
the first position. Now may be a good time to check 'Map
Properties' in MapTools to see how much space is being taken up.<br>
<br>
<strong>Import</strong>. This is used to get your tile graphics into your
map, see <a href="#imgfmts">supported image formats</a>.<br>
<center><img src="images/TEST.BMP" alt="images/TEST.BMP"></center><br>
The editor defaults to simpleimport, this allows you to import one image
file and update or add more graphics by modifying the image file and importing again.
If you disable simpleimport in the mapwin.ini file (not recommended),
you can import more than one image file, when you have selected the image
file to import, you will get the question: "Make all
imported graphics into NEW block structures?" If you answer
'Yes' new blocks will be created in the Block Editor 'still'
window that have each new graphic tile as the BG (see Block
Structures in the <a href="#glossary">glossary</a>), if you
answer 'No' you will be asked: "Replace existing
graphics?". Answering 'Yes' to that will write over the
current map graphics (except the special first one), the most
common reason to do that is when you have updated the map graphics.
If you have added more blocks to the end you will be asked if you
want new structures for the new blocks.
If you say 'No' to replacing existing graphics the new ones will
be added to the map, but won't be visible until you incorporate
them into a Block Structure.<br>
You can also import Map Array (.MAR and .MAP) layers here, these MUST have been
previously exported from this map, and you must not have altered
the block order.<br>
<br>
<strong>Import at</strong>. Please use import instead<br><br>
<strong>Export</strong>. You can export individual parts of the map as
separate files, which you may need for various reasons, though
the playback libs use the FMP files.
Click the checkboxes to indicate what to export
(they will be given the name at the top of the dialogue with
the indicated extension and be put in the same
directory as the map file). <br>
<strong>?.MAR</strong> The current layer map array is saved as
an array of short ints mapwidth wide by mapheight high, so
a 100*100 map would produce a 20000byte .MAR file. These .MAR
files can be re-imported ('import' in the File menu) if you
don't change the block order in the Block editor window. Most
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -