Navigation

Symbol Metadata Files for .PNG symbols


With vector based symbols in FM, you've always been able to specify a scale.  That is, if you make a vector symbol of a house thats 20 feet across, when you place it on a map, the symbol will be sized at 20 feet across.

If you're creating .PNG based mapping symbols, or working with them a lot, a question may cross your mind - how exactly do you assign a scale to the symbols?  There's no way, after all, to specify the size at which the .PNG based symbol should show up on the map within the .PNG file itself.

If you look into the directories that contain the Battlemap symbols, you'll get a hint of how FM8 handles the problem.  FM8 uses small .xml files that contain metadata for the symbol.  This metadata contains an entry that tells FM the size at which the .PNG file should be shown on the map.

<?xml version='1.0' encoding='UTF-8' ?>
<symbol>
 <pixel size='0.02' unit='Feet'/>
</symbol> 


There's two ways of adding a metadata file.  If all the symbols in a particular symbol category have the same pixels-per-feet, you can place a single metadata file called 'default.xml' into the directory for those .PNG files.  Just use the above xml file as an example, adjusting the 'size' attribute as needed.

If, on the other hand, you have .PNG images in a directory that may have different resolutions from each other, you'll need to add a metadata file for each .PNG.  In that case, name the metadata file the same as the symbol file it describes, only tack on .xml at the end.  For example, a metadata file for 'PineTree.png' would be called 'PineTree.png.xml'.

With these files in place, when FM initially displays a .PNG based mapping symbol, it will look at the metadata file (either the one specifically for the .PNG image, or the 'default.xml' file) to get the proper scaling.  If no metadata file exists for the symbol, FM will place the symbol based on the pixel size of the image, adjusting so that it fits.


Last edited by NBOS on 2008-04-28 01:51:26
Copyright © 2003-2007, NBOS Software. All rights reserved. 'Fractal Mapper', 'ScreenMonkey', 'Character Sketcher', 'Inspiration Pad',
'Fractal World Explorer', 'Goblin API', 'AstroSynthesis' are trademarks of NBOS Software. 'Dwarven Beserker' art by V. Shane.
Member contributed resources