movedOverDrawing: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Fix usage example to call the correct function)
Line 9: Line 9:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
getDrawingInfo(mapName, drawingId, path)
movedOverDrawing(mapName, drawingId, path)
</source>
</source>
'''Parameters'''
'''Parameters'''

Revision as of 18:23, 25 May 2022

movedOverDrawing() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.5.2
Use to check if a given path has crossed through a specified drawing including templates. The easiest way to discover a drawing's Id is via the Draw Explorer interface. Returns a JSON array with coordinates of all cells in the path that overlap with the area defined by the given drawing.

Usage

movedOverDrawing(mapName, drawingId, path)

Parameters

  • mapName - A string containing the name of the map.
  • drawingId - A string containing the id of the drawing.
  • path - JSON array of X/Y coordinate such as that returned by getLastPath()

Examples

[h: lp = getLastPath()]
[h: id = findDrawings(getCurrentMapName(),"fig1")] 
[r: movedOverDrawing(getCurrentMapName(),id,lp)]

See Also