MapDocument

Individual document for parallel editing

class MapDocument : MouseEventReceptor {}

Constructors

this
this(string filename)

Loads the document from disk.

this
this(string docName, int resX, int resY)

New from scratch

Members

Enums

EditMode
enum EditMode

Specifies the current edit mode

Functions

addTileSet
void addTileSet(int layer, ABitmap[ushort] tiles)
void addTileSet(int layer, ABitmap[] tiles)

Puts the loaded tiles onto a TileLayer

assignImportedTilemap
void assignImportedTilemap(MappingElement[] map, int w, int h)

Assigns an imported tilemap to the currently selected layer.

changeLayerPriority
void changeLayerPriority(int newPri)

Moves the priority of a layer.

clearSelection
void clearSelection()

Clears selection area.

contScrollLayer
void contScrollLayer()

Scrolls the selected layer by the amount set. Should be called for every frame.

copy
void copy()

Creates a copy event if called. Uses the internal states of this document.

createMapClipboardItem
MapClipboard.Item createMapClipboardItem()

Copies an area on a tilelayer to a MapClipboard item.

cut
void cut()

Creates a cut event if called. Uses the internal states of this document.

deleteArea
void deleteArea()

Deletes the selected area.

fillSelectedArea
void fillSelectedArea()

Fills selected area with selected tile, using overwrite rules defined by the materiallist.

flipTilesHoriz
void flipTilesHoriz()

Flips selected tiles horizontally.

flipTilesVert
void flipTilesVert()

Flips selected tiles vertically.

getLayerInfo
LayerInfo getLayerInfo(int pri)
Undocumented in source. Be warned that the author may not have intended to support it.
moveSelection
void moveSelection(int x, int y)

Moves the selected area by the given amounts.

nextLayerNumber
int nextLayerNumber()

Returns the next available layer number.

onSelectContextMenuSelect
void onSelectContextMenuSelect(Event ev)

Context menu for selection events go here

onSelection
void onSelection()
Undocumented in source. Be warned that the author may not have intended to support it.
passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)
Undocumented in source. Be warned that the author may not have intended to support it.
passMME
void passMME(MouseEventCommons mec, MouseMotionEvent mme)
Undocumented in source. Be warned that the author may not have intended to support it.
passMWE
void passMWE(MouseEventCommons mec, MouseWheelEvent mwe)
Undocumented in source. Be warned that the author may not have intended to support it.
paste
void paste(size_t which)

Creates a paste event if called. Uses the internal states of this document.

removeLayer
void removeLayer()

Removes a layer.

removeTile
void removeTile(int id)

Removes a tile from the material list.

renameLayer
void renameLayer(string newName)

Renames a layer.

renameTile
void renameTile(int id, string name)

Renames a tile on the material list.

scrollSelectedLayer
void scrollSelectedLayer(int x, int y)

Scrolls the selected layer by a given amount.

selMirrorBoth
void selMirrorBoth()

Mirrors selected items horizontally and vertically.

selMirrorHoriz
void selMirrorHoriz()

Mirrors selected items horizontally.

selMirrorVert
void selMirrorVert()

Mirrors selected items vertically.

setContScroll
void setContScroll(int x, int y)

Sets the continuous scroll amounts.

tileMaterial_Down
void tileMaterial_Down()
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_FlipHorizontal
void tileMaterial_FlipHorizontal(bool pos)
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_FlipHorizontal
void tileMaterial_FlipHorizontal()
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_FlipVertical
void tileMaterial_FlipVertical(bool pos)
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_FlipVertical
void tileMaterial_FlipVertical()
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_PaletteDown
ushort tileMaterial_PaletteDown()
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_PaletteUp
ushort tileMaterial_PaletteUp()
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_Select
void tileMaterial_Select(wchar id)
Undocumented in source. Be warned that the author may not have intended to support it.
tileMaterial_Up
void tileMaterial_Up()
Undocumented in source. Be warned that the author may not have intended to support it.
updateLayerList
void updateLayerList()

Updates the layers for this document.

updateMaterialList
void updateMaterialList()

Updates the material list for the selected layer.

updateSelection
void updateSelection()

Updates the selection on the raster window.

Properties

voidfill
bool voidfill [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
voidfill
bool voidfill [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

DISPL_SELECTION
enum DISPL_SELECTION;

If set, then selection is shown

LAYER_SCROLL
enum LAYER_SCROLL;

If set, then layer is being scrolled.

PLACEMENT
enum PLACEMENT;

To solve some "debounce" issues around mouse click releases

VOIDFILL_EN
enum VOIDFILL_EN;

If set, tilePlacement overrides only transparent (0xFFFF) tiles.

Variables

areaSelection
Box areaSelection;

Contains the selected layer area parameters in pixels

events
UndoableStack events;

Per document event stack

filename
string filename;

Null if not yet saved, otherwise name of the target file

flags
uint flags;

Various status flags combined into one.

layerList
LayerInfo[] layerList;

Local layerinfo for data lookup

mainDoc
MapFormat mainDoc;

Used to reduce duplicate data as much as possible

mapSelection
Box mapSelection;

Contains the selected map area parameters

mode
EditMode mode;

Mose event mode selector

outputWindow
RasterWindow outputWindow;

Window used to output the screen data

paletteReturnFunc
Color[] delegate(MapDocument sender) paletteReturnFunc;

Used for adding the palette for the document

prevMouseX
int prevMouseX;

Previous mouse X position

prevMouseY
int prevMouseY;

Previous mouse Y position

sXAmount
int sXAmount;

Continuous X scroll amount

sYAmount
int sYAmount;

Continuous Y scroll amount

selectedLayer
int selectedLayer;

Indicates the currently selected layer

selectedMappingElement
MappingElement selectedMappingElement;

Currently selected mapping element to write, including mirroring properties, palette selection, and priority attributes

Inherited Members

From MouseEventReceptor

passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)

Passes mouse click event

passMME
void passMME(MouseEventCommons mec, MouseMotionEvent mme)

Passes mouse move event

passMWE
void passMWE(MouseEventCommons mec, MouseWheelEvent mwe)

Passes mouse scroll event

Meta