-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapfile specification.txt
133 lines (130 loc) · 12.2 KB
/
mapfile specification.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
How to read this specification:
The pymapper map file is based on tags to initiate actions when pymapper is reading the file.
The tags are shown in CAPS, with required arguments in <braces>. Only one tag per line is allowed, unless
explicitly noted. An explanation of the arguments is given after a # mark.
The # mark should not be included in the arguments.
Questions about this specification should be sent to pymapper@gmail.com or visit http://pymapper.com.
This specification covers version 2.4 of the mapfile specification.
# This is a comment line. Anything after the tag is ignored by pymapper.
MAPFILE #This tag is required as the first active tag. No other tag (other than #) is allowed before this tag.
VERSION <version> #version denotes the version of the mapfile. Currently version = 2.4
LOAD_DUNGEON_RESOURCES #If this tag is present, load up the d20/5e/OGL resources before loading the rest of the mapfile
MAP_LAYERS #This tag starts the list of layers in the map.
<LayerName> <LayerDisplay> #each line after the MAP_LAYERS tag has the name of the layer, and whether it is displayed on the map
END_LAYERS #Ends the definition of the map layers
TILESET <filename> <tilesetID> #pymapper will try to load the tileset from <filename> first, and if it is not found, then it will try to load from /tiles/<tilesetID>
SNAP_GRID <SnapToGrid> #tiles will snap to grid if <SnapToGrid> is ON or OFF
GRID_COLOR <red> <green> <blue> <alpha> #Display the grid color with the given RGB+A; values are between 0-255. <alpha> is the transparency value.
MAP_ZOOM <zoomfactor> #<zoomfactor> is an integer value used internally in pymapper. It is essentially the number of pixels per map square.
ROWS <rows> #specify the number of <rows> in the map
COLUMNS <columns> #specify the number of <columns> in the map
VIEWGRID <view> #<view> can be ON or OFF
MAP_PAGES #Tag starts a list of definitions for pages in the map
START_PAGE #Begin page definition
PAGE_ID <pageID> #unique integer ID of the page. First page starts at 0 and counts up
PAGE_ZOOM <zoomfactor> #same as the MAP_ZOOM factor, but the value is for this page only
PAGE_XSCROLL <Xscroll> #float value for how much to scroll the view in the X direction
PAGE_YSCROLL <Xscroll> #float value for how much to scroll the view in the Y direction savefile.write("PAGE_NAME\n")
PAGE_NAME #Next line is the name of the page
<pagename> #The name of the current page in the definition
PAGE_BACKGROUND_FILENAME #the next lines are the filename and path for the page background display
<filename> #the filename only, ie, background.jpg
<filepath> #the path only. ie, c:\games\dungeon\
PAGE_BACKGROUND_DISPLAY_MODE <mode> #<mode> may be Register, Tile, or Center. This determines how the background is displayed on the map
PAGE_BACKGROUND_DIMENSION <grid_width> <grid_height> #This tag is required regardless of display mode. If mode is Tile then this defines the size of the background image in map squares. Each value is an integer.
END_PAGE #Ends the definition for this page. The next tag may be START_PAGE to define a new page, or END_MAP_PAGES to end page definition.
END_MAP_PAGES #Ends the definition of map pages
BEGIN_MAP_DEFINITION #Starts definition of the map tiles
TILE <tilesetID> <tileID> #Select a tile from <tilesetID> with the <tileID>. Each tile in the tileset has a unique <tileID> that is assigned when reading the tileset file.
POSITION <xpos> <ypos> #the position of the tile in the map file. <xpos> and <ypos> are float values that define the position in number of squares from the origin.
B_SIDE #if this tag is present, then the B (reverse) side is shown
A_SIDE #if this tag is present, then the A (front) side is shown
ROTATION <rotation> #<rotation> is a float value in degrees that the tile is rotated clockwise
TILE_LAYER <layername> #place the tile on <layername> for display
TILE_PAGE <pagename> #place the tile on <pagename> for display
END_TILE #end definition for this tile. next tag may be TILE or END_MAP_DEFINITION
END_MAP_DEFINITION #end the map definition for the tiles
ANNOTATIONS #start the list of map annotations (text lines)
TEXT <xposition> <yposition> <text> #Set the <xposition> and <yposition> for the text in <text>. The positioning is in units of map squares and are float numbers.
FONT_PT_SIZE <size> #size of the text in points. 72 pt = 1 inch
FONT_FAMILY <family> #<family> is a value generated by the font manager
FONT_STYLE <style> #<style> is a value generated by the font manager
FONT_WEIGHT <weight> #<weight> is a value generated by the font manager
FONT_FACENAME <face> #<face> is a value generated by the font manager
TEXT_BG <red> <green> <blue> #set the background of the annotation to the RGB color specified. Values are 0-255
TEXT_FG <red> <green> <blue> #set the foreground of the annotation to the RGB color specified. Values are 0-255
OPAQUE <OnOff> #If ON then draw the background color. If OFF then only the text is drawn.
ANNO_PAGE #the next line has the page name to display the text on.
<AnnoPageName> #used with ANNO_PAGE
END_TEXT #end the current annotation definition
END_ANNOTATIONS #end the definition for text annotations
ROOM_ICONS #start definition of the list of icons; only written if icons are present
ROOM_INFO_START #start definition of an icon
ROOM_DESCRIPTION #next line contains the description (ie, title or name) of the icon
<description> #text to use as the icon description
ROOM_ICON <IconType> #<IconType> may be either 'Trap' 'Monster' 'NPC' 'Treasure' or 'Room' This affects the bitmap displayed on the map at the icon position.
ROOM_LAYER <layer> #which <layer> to display on?
ROOM_POSITION <xposition> <yposition> #The X and Y position of the icon in units of map squares. Float values.
ROOM_XML_FILE #the next line has the filename (without path) of the text file to load when editing the information.
<filename> #filename of the text used in this icon.
ROOM_XML_PATH #the next line has the filepath (without filename)
<filepath> #path where the text is located
ROOM_PAGE #the next line has the page name to display this icon on.
<pagename>
ROOM_INFO_END #end definition for this icon. Next line may be another icon, or the end.
ROOM_ICONS_END #end definition of all icons.
BEGIN_DRAWING_ITEMS #if drawing items are present, begin definition of these items
DRAW_FREEHAND #begin definition of a freehand line
XY_POINT <xposition> <yposition> #Point on the freehand line. There will be at least two of these tags for the line. Float values in map squares units.
LINE_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
LINE_WIDTH <width> #pixel width of the line. Integer value
LINE_STYLE <style> #style of the line, ie, solid, dash, dot, etc. Internal wxPython value
BRUSH_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_FREEHAND #end definition of the freehand line.
DRAW_LINE #start definition of a two point line. The same tags used in a freehand line apply to this tag.
END_LINE #end definition of the line
DRAW_MULTILINE #start definition of a multiline (line segments drawn end to end). The same tags used in a freehand line apply to this tag.
END_MULTILINE #end definition of a multiline
DRAW_OUTLINE_RECT #begin definition of a outlined rectangle.
RECT <xpos> <ypos> <width> <height> #set the x and y position, and the width, height of the rectangle. Units in map squares and are float values. The origin of the rect is in the top left corner, positive to the right and down.
LINE_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
LINE_WIDTH <width> #pixel width of the line. Integer value
LINE_STYLE <style> #style of the line, ie, solid, dash, dot, etc. Internal wxPython value
BRUSH_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_OUTLINE_RECT #end definition of the rectangle.
DRAW_FILL_RECT #draw a filled rectangle
RECT <xpos> <ypos> <width> <height> #set the x and y position, and the width, height of the rectangle. Units in map squares and are float values. The origin of the rect is in the top left corner, positive to the right and down.
LINE_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
LINE_WIDTH <width> #pixel width of the line. Integer value
LINE_STYLE <style> #style of the line, ie, solid, dash, dot, etc. Internal wxPython value
BRUSH_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_FILL_RECT #end definition of the filled rect.
DRAW_OUTLINE_CIRCLE #draw an outlined circle
CIRCLE <xpos> <ypos> <radius> #draw at the X, Y and radius of the circle. Units in map squares; float values.
LINE_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
LINE_WIDTH <width> #pixel width of the line. Integer value
LINE_STYLE <style> #style of the line, ie, solid, dash, dot, etc. Internal wxPython value
BRUSH_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_OUTLINE_CIRCLE #end the definition of the outline circle
DRAW_FILLED_CIRCLE #draw a filled circle
CIRCLE <xpos> <ypos> <radius> #draw at the X, Y and radius of the circle. Units in map squares; float values.
LINE_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
LINE_WIDTH <width> #pixel width of the line. Integer value
LINE_STYLE <style> #style of the line, ie, solid, dash, dot, etc. Internal wxPython value
BRUSH_COLOR <red> <green> <blue> <alpha> #RGB+A color of the line. Alpha is the transparency. Integer values from 0-255
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_FILLED_CIRCLE #end filled circle.
DRAW_IMAGE #draw a user defined bitmap
RECT <xpos> <ypos> <width> <height> #set the x and y position, and the width, height of the rectangle. Units in map squares and are float values. The origin of the rect is in the top left corner, positive to the right and down.
IMAGE_FILENAME #next line is the name of the image to load. (without the path)
<filename>
IMAGE_PATH #the next line has the path where the image is located.
<filepath>
PAGE_INDEX <index> #<index> is the 0 based index where to display the item. The index in used in place of the name of the page.
END_IMAGE #end definition of the image.
END_DRAWING_ITEMS #end definition of the drawing items.
END_MAP_FILE #final tag in the file. Must be included in all map files. Loading stops after this tag.