getDrawingInfo

From RPTools Wiki
Jump to navigationJump to search

getDrawingInfo() Function

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

Introduced in version 1.5.2
Returns extensive information about the specified drawing. The information is returned as a JSON object.

Usage

getDrawingInfo(mapName, drawingId)

Parameters

  • mapName - A string containing the name of the map.
  • drawingId - A string containing the id of the drawing. The easiest way to discover a drawing's Id is via the Draw Explorer interface.

Examples

[h: id = findDrawings(getCurrentMapName(),"Funky Shape")]
[h: dinfo = getDrawingInfo(getCurrentMapName(), id)]
<pre>[r: json.indent(dinfo,2)]</pre>

Returns

 1 {
 2   "fillColor": "#ffffff",
 3   "path":   [
 4         {
 5       "x": 250,
 6       "y": 200
 7     },
 8         {
 9       "x": 250,
10       "y": 400
11     },
12         {
13       "x": 500,
14       "y": 400
15     },
16         {
17       "x": 500,
18       "y": 200
19     },
20         {
21       "x": 400,
22       "y": 200
23     },
24         {
25       "x": 400,
26       "y": 300
27     },
28         {
29       "x": 350,
30       "y": 300
31     },
32         {
33       "x": 350,
34       "y": 200
35     },
36         {
37       "x": 250,
38       "y": 200
39     }
40   ],
41   "penWidth": 3,
42   "name": "Funky Shape",
43   "bounds":   {
44     "x": 250,
45     "width": 250,
46     "y": 200,
47     "height": 200
48   },
49   "penColor": "#000000",
50   "id": "B7041D43935D4BDCA330E431D892DEAB",
51   "type": "Polygon",
52   "opacity": 1,
53   "isEraser": 0,
54   "layer": "TOKEN"
55 }

See Also