https://wiki.roll20.net/index.php?title=API:Objects/Path&feed=atom&action=historyAPI:Objects/Path - Revision history2024-03-29T01:25:21ZRevision history for this page on the wikiMediaWiki 1.20.3https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=31587&oldid=prev1223200: transclusion2022-04-23T13:30:26Z<p>transclusion</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 13:30, 23 April 2022</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>{{revdate}}{{apibox}}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"><noinclude></ins>{{revdate}}{{apibox}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{main|API:Objects}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{main|API:Objects}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The {{code|path}} object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The {{code|path}} object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Path Object ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Path Object ==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"></noinclude></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{| class="wikitable"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{| class="wikitable"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 85:</td>
<td colspan="2" class="diff-lineno">Line 85:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''All Players''' is represented by having {{code|all}} in the list.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>'''All Players''' is represented by having {{code|all}} in the list.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"><noinclude></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Most of these properties are either self-explanatory or easy to grasp. It is the <code>_path</code> property, however, which is complicated and requires some further study.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Most of these properties are either self-explanatory or easy to grasp. It is the <code>_path</code> property, however, which is complicated and requires some further study.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 184:</td>
<td colspan="2" class="diff-lineno">Line 184:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:API Development]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:API Development]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></noinclude></ins></div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=31539&oldid=prev1223200: New Keys: One-Way barriers2022-04-19T15:21:01Z<p>New Keys: One-Way barriers</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:21, 19 April 2022</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 70:</td>
<td colspan="2" class="diff-lineno">Line 70:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| 1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| 1</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| Vertical scale factor for the path.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| Vertical scale factor for the path.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|-</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| barrierType</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| "wall"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| 'oneWay' or 'wall' . For creating [[One-Way Barrier]]. {{source|https://app.roll20.net/forum/permalink/10808632/ April 14, 2022}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">|-</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| oneWayReversed</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">| false or true . For [[One-Way Barrier]]. helpful in changing the direction the arrows are facing{{source|https://app.roll20.net/forum/permalink/10808632/ April 14, 2022}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| controlledby</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| controlledby</div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=30249&oldid=prev1223200 at 10:30, 17 February 20222022-02-17T10:30:33Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 10:30, 17 February 2022</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{revdate}}{{apibox}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{revdate}}{{apibox}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{main|API:Objects}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{main|API:Objects}}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The <del class="diffchange diffchange-inline">'''</del>path<del class="diffchange diffchange-inline">''' </del>object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The <ins class="diffchange diffchange-inline">{{code|</ins>path<ins class="diffchange diffchange-inline">}} </ins>object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Path Object ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Path Object ==</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 13:</td>
<td colspan="2" class="diff-lineno">Line 13:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _id</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _id</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|  </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|  </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| A unique ID for this object. Globally unique across all objects in this <del class="diffchange diffchange-inline">campaign</del>. Read-only.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| A unique ID for this object. Globally unique across all objects in this <ins class="diffchange diffchange-inline">game</ins>. Read-only.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _type</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _type</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _path</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| _path</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| A JSON string describing the lines in the path. Read-only. See [[#Path Property|Path Property]] below for more information.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| A JSON string describing the lines in the path. Read-only. See [[<ins class="diffchange diffchange-inline">API:Objects/Path</ins>#Path Property|Path Property]] below for more information.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| fill</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| fill</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 41:</td>
<td colspan="2" class="diff-lineno">Line 41:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| layer</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| layer</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| ""</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| ""</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Current <del class="diffchange diffchange-inline">layer</del>, one of <del class="diffchange diffchange-inline">"</del>gmlayer<del class="diffchange diffchange-inline">"</del>, <del class="diffchange diffchange-inline">"</del>objects<del class="diffchange diffchange-inline">"</del>, <del class="diffchange diffchange-inline">"</del>map<del class="diffchange diffchange-inline">"</del>, or <del class="diffchange diffchange-inline">"</del>walls<del class="diffchange diffchange-inline">"</del>. The walls layer is used for <del class="diffchange diffchange-inline">dynamic lighting</del>, and paths on the walls layer will block light.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Current <ins class="diffchange diffchange-inline"><span style="font-family:Pictos;">b</span> [[Layer]]</ins>, one of <ins class="diffchange diffchange-inline"><code></ins>gmlayer<ins class="diffchange diffchange-inline"></code></ins>, <ins class="diffchange diffchange-inline"><code></ins>objects<ins class="diffchange diffchange-inline"></code></ins>, <ins class="diffchange diffchange-inline"><code></ins>map<ins class="diffchange diffchange-inline"></code></ins>, or <ins class="diffchange diffchange-inline"><code></ins>walls<ins class="diffchange diffchange-inline"></code></ins>. The <ins class="diffchange diffchange-inline"><code></ins>walls<ins class="diffchange diffchange-inline"></code>-</ins>layer is used for <ins class="diffchange diffchange-inline">[[Dynamic Lighting]]</ins>, and paths on the <ins class="diffchange diffchange-inline"><code></ins>walls<ins class="diffchange diffchange-inline"></code>-</ins>layer will block light <ins class="diffchange diffchange-inline">between [[tokens]]</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| stroke_width</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| stroke_width</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 74:</td>
<td colspan="2" class="diff-lineno">Line 74:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| ""</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| ""</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| Comma-delimited list of player IDs who can control the path. Controlling players may delete the path. If the path was created by a player, that player is automatically included in the list.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| Comma-delimited list of player IDs who can control the path. Controlling players may delete the path. If the path was created by a player, that player is automatically included in the list.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">'''All Players''' is represented by having {{code|all}} in the list.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 84:</td>
<td colspan="2" class="diff-lineno">Line 86:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Once parsed, you'll see that the <code>_path</code> is an array of arrays. Depending on the type of path, the arrays will be different. There are three possible types of paths:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Once parsed, you'll see that the <code>_path</code> is an array of arrays. Depending on the type of path, the arrays will be different. There are three possible types of paths:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* Polygon: this includes open polygons, closed polygons, line segments, rectangles, and squares. Squares and rectangles are formed with the "Draw Shape" tool without holding the Alt key. All other polygons are formed with the "Polygon/Line" tool.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Polygon: this includes open polygons, closed polygons, line segments, rectangles, and squares. Squares and rectangles are formed with the "<ins class="diffchange diffchange-inline">[[</ins>Draw Shape<ins class="diffchange diffchange-inline">]]</ins>" tool without holding the <ins class="diffchange diffchange-inline">{{button|</ins>Alt<ins class="diffchange diffchange-inline">}} </ins>key. All other polygons are formed with the "Polygon/Line" tool.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* Oval: this includes both ovals and circles. Both are formed with the "Draw Shape" tool while holding the Alt key.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Oval: this includes both ovals and circles. Both are formed with the "Draw Shape" tool while holding the <ins class="diffchange diffchange-inline">{{button|</ins>Alt<ins class="diffchange diffchange-inline">}} </ins>key.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Freehand: formed with the "Freehand" tool.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Freehand: formed with the "Freehand" tool.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 137:</td>
<td colspan="2" class="diff-lineno">Line 139:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>In all of the demonstration images above for the <del class="diffchange diffchange-inline">''</del>C<del class="diffchange diffchange-inline">'' </del>arrays, the blue arrow is pointing at the midpoint of the relevant edge of the rectangle. The red and green arrows are pointing at approximately the 1/4 or 3/4 mark of the relevant edges, as appropriate. The red and green arrows are '''not''' pointing at the circle itself.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>In all of the demonstration images above for the <ins class="diffchange diffchange-inline">{{code|</ins>C<ins class="diffchange diffchange-inline">}} </ins>arrays, the blue arrow is pointing at the midpoint of the relevant edge of the rectangle. The red and green arrows are pointing at approximately the 1/4 or 3/4 mark of the relevant edges, as appropriate. The red and green arrows are '''not''' pointing at the circle itself.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Freehand Paths ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Freehand Paths ===</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 165:</td>
<td colspan="2" class="diff-lineno">Line 167:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Because of how the freehand paths are drawn, the Bézier curves that compose it will generally be very short; the control points will generally be very close to the start point of the curve (the end point of the previous curve).</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Because of how the freehand paths are drawn, the Bézier curves that compose it will generally be very short; the control points will generally be very close to the start point of the curve (the end point of the previous curve).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">=</del>== Analyzing Path Values <del class="diffchange diffchange-inline">=</del>==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>== Analyzing Path Values ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>All points in the <code>_path</code> property are relative to the top-left corner of the path's bounding rectangle. So, a point of <code>0,0</code> is at the top of the path and the left of the path, but that does not necessarily mean the path is at the top-left of the map -- that's taken care of by the <code>top</code> and <code>left</code> properties.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>All points in the <code>_path</code> property are relative to the top-left corner of the path's bounding rectangle. So, a point of <code>0,0</code> is at the top of the path and the left of the path, but that does not necessarily mean the path is at the top-left of the map -- that's taken care of by the <code>top</code> and <code>left</code> properties.</div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=30245&oldid=prev1223200 at 10:16, 17 February 20222022-02-17T10:16:08Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 10:16, 17 February 2022</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>{{apibox}}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">{{revdate}}</ins>{{apibox}}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">{{main|API:Objects}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The '''path''' object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The '''path''' object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 173:</td>
<td colspan="2" class="diff-lineno">Line 173:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Paths are not necessarily all clockwise or all counterclockwise; you cannot guarantee that any algorithm that cares about winding order will function as desired, not to mention the possibility of complex polygons. Squares and rectangles are clockwise, but there is nothing to distinguish a rectangle from some other arbitrary polygon.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Paths are not necessarily all clockwise or all counterclockwise; you cannot guarantee that any algorithm that cares about winding order will function as desired, not to mention the possibility of complex polygons. Squares and rectangles are clockwise, but there is nothing to distinguish a rectangle from some other arbitrary polygon.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[Category:API<del class="diffchange diffchange-inline">|Path</del>]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[[Category:API <ins class="diffchange diffchange-inline">Development</ins>]]</div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=3483&oldid=prev612473: /* Path Object */2014-11-05T04:24:36Z<p><span dir="auto"><span class="autocomment">Path Object</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 04:24, 5 November 2014</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 29:</td>
<td colspan="2" class="diff-lineno">Line 29:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| fill</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| fill</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| "transparent"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| "transparent"</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Fill color. Use the string "transparent" <del class="diffchange diffchange-inline">of </del>a hex color as a string, for example "#000000"</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Fill color. Use the string "transparent" <ins class="diffchange diffchange-inline">or </ins>a hex color as a string, for example "#000000"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| stroke</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| stroke</div></td></tr>
</table>612473https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=1458&oldid=prev235259: /* Oval Paths */ updated doc to describe the bezier curve stuff2013-10-05T08:21:17Z<p><span dir="auto"><span class="autocomment">Oval Paths: </span> updated doc to describe the bezier curve stuff</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:21, 5 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 125:</td>
<td colspan="2" class="diff-lineno">Line 125:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 0, 17.5, 17.5, 0, 35, 0]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 0, 17.5, 17.5, 0, 35, 0]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the top-left corner.<br>[[File:Circle Path C1.png]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the top-left corner<ins class="diffchange diffchange-inline">. The first two points are Bézier control points, and the third is an endpoint for the Bézier curve</ins>.<br>[[File:Circle Path C1.png]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 52.5, 0, 70, 17.5, 70, 35]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 52.5, 0, 70, 17.5, 70, 35]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the top-right corner.<br>[[File:Circle Path C2.png]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the top-right corner<ins class="diffchange diffchange-inline">. The first two points are Bézier control points, and the third is an endpoint for the Bézier curve</ins>.<br>[[File:Circle Path C2.png]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| style="white-space:nowrap" | <code>["C", 70, 52.5, 52.5, 70, 35, 70]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| style="white-space:nowrap" | <code>["C", 70, 52.5, 52.5, 70, 35, 70]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the bottom-right corner.<br>[[File:Circle Path C3.png]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the bottom-right corner<ins class="diffchange diffchange-inline">. The first two points are Bézier control points, and the third is an endpoint for the Bézier curve</ins>.<br>[[File:Circle Path C3.png]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 17.5, 70, 0, 52.5, 0, 35]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["C", 17.5, 70, 0, 52.5, 0, 35]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the bottom-left corner. The third point is equal to the ''M'' point.<br>[[File:Circle Path C4.png]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Three points along the oval's bounding box near the bottom-left corner<ins class="diffchange diffchange-inline">. The first two points are Bézier control points, and the third is an endpoint for the Bézier curve</ins>. The third point is equal to the ''M'' point.<br>[[File:Circle Path C4.png]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>In all of the demonstration images above for the ''C'' arrays, the blue arrow is pointing at the midpoint of the relevant edge of the rectangle. The red and green arrows are pointing at the 1/4 or 3/4 mark of the relevant edges, as appropriate. The red and green arrows are '''not''' pointing at the circle itself.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>In all of the demonstration images above for the ''C'' arrays, the blue arrow is pointing at the midpoint of the relevant edge of the rectangle. The red and green arrows are pointing at <ins class="diffchange diffchange-inline">approximately </ins>the 1/4 or 3/4 mark of the relevant edges, as appropriate. The red and green arrows are '''not''' pointing at the circle itself.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Freehand Paths ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Freehand Paths ===</div></td></tr>
</table>235259https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=1457&oldid=prev235259: /* Freehand Paths */ updated documentation based on Riley's information2013-10-05T08:09:46Z<p><span dir="auto"><span class="autocomment">Freehand Paths: </span> updated documentation based on Riley's information</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:09, 5 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 152:</td>
<td colspan="2" class="diff-lineno">Line 152:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["Q", 0, 44, 0.5, 44]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["Q", 0, 44, 0.5, 44]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Two points: <del class="diffchange diffchange-inline">the previous </del>point <del class="diffchange diffchange-inline">in the path</del>, and the <del class="diffchange diffchange-inline">current </del>point <del class="diffchange diffchange-inline">in </del>the <del class="diffchange diffchange-inline">path</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Two points: <ins class="diffchange diffchange-inline">a Bézier control </ins>point, and the <ins class="diffchange diffchange-inline">ending </ins>point <ins class="diffchange diffchange-inline">of </ins>the <ins class="diffchange diffchange-inline">curve</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| colspan="3" | ...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| colspan="3" | ...</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| style="white-space:nowrap" | <code>["Q", 366.5, 55, 368, 54.5]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| style="white-space:nowrap" | <code>["Q", 366.5, 55, 368, 54.5]</code></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>| Two points: <del class="diffchange diffchange-inline">the previous </del>point <del class="diffchange diffchange-inline">in the path</del>, and the <del class="diffchange diffchange-inline">current </del>point <del class="diffchange diffchange-inline">in </del>the <del class="diffchange diffchange-inline">path</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>| Two points: <ins class="diffchange diffchange-inline">a Bézier control </ins>point, and the <ins class="diffchange diffchange-inline">ending </ins>point <ins class="diffchange diffchange-inline">of </ins>the <ins class="diffchange diffchange-inline">curve</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["L", 369.5, 54]</code></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>| <code>["L", 369.5, 54]</code></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 163:</td>
<td colspan="2" class="diff-lineno">Line 163:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">While </del>the freehand <del class="diffchange diffchange-inline">path is essentially a linked list of points, there </del>are <del class="diffchange diffchange-inline">occasionally small differences (less than one pixel) between </del>the <del class="diffchange diffchange-inline">"current point in </del>the <del class="diffchange diffchange-inline">path" of one array and </del>the <del class="diffchange diffchange-inline">"previous </del>point <del class="diffchange diffchange-inline">in </del>the <del class="diffchange diffchange-inline">path" </del>of the <del class="diffchange diffchange-inline">next array</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Because of how </ins>the freehand <ins class="diffchange diffchange-inline">paths </ins>are <ins class="diffchange diffchange-inline">drawn, </ins>the <ins class="diffchange diffchange-inline">Bézier curves that compose it will generally be very short; </ins>the <ins class="diffchange diffchange-inline">control points will generally be very close to </ins>the <ins class="diffchange diffchange-inline">start </ins>point <ins class="diffchange diffchange-inline">of </ins>the <ins class="diffchange diffchange-inline">curve (the end point </ins>of the <ins class="diffchange diffchange-inline">previous curve)</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Analyzing Path Values ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Analyzing Path Values ===</div></td></tr>
</table>235259https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=1431&oldid=prev235259: /* Path Property */2013-10-04T00:02:15Z<p><span dir="auto"><span class="autocomment">Path Property</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:02, 4 October 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 82:</td>
<td colspan="2" class="diff-lineno">Line 82:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The <code>_path</code> property is a JSON string, and is a read-only property of the Path object. In order to make use of the <code>_path</code> property, you must use <code>JSON.parse(myPath.get("path"))</code>.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The <code>_path</code> property is a JSON string, and is a read-only property of the Path object. In order to make use of the <code>_path</code> property, you must use <code>JSON.parse(myPath.get("path"))</code>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Once parsed, you'll see that the <code>_path</code> is an array of arrays. Depending on the type of path, the arrays will be different. There are three possible <del class="diffchange diffchange-inline">type </del>of paths:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Once parsed, you'll see that the <code>_path</code> is an array of arrays. Depending on the type of path, the arrays will be different. There are three possible <ins class="diffchange diffchange-inline">types </ins>of paths:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Polygon: this includes open polygons, closed polygons, line segments, rectangles, and squares. Squares and rectangles are formed with the "Draw Shape" tool without holding the Alt key. All other polygons are formed with the "Polygon/Line" tool.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Polygon: this includes open polygons, closed polygons, line segments, rectangles, and squares. Squares and rectangles are formed with the "Draw Shape" tool without holding the Alt key. All other polygons are formed with the "Polygon/Line" tool.</div></td></tr>
</table>235259https://wiki.roll20.net/index.php?title=API:Objects/Path&diff=1430&oldid=prev235259: new2013-10-04T00:01:31Z<p>new</p>
<p><b>New page</b></p><div>{{apibox}}<br />
<br />
The '''path''' object is special in a few ways; most notably, paths may be placed on the [[Dynamic Lighting]] layer to create shadows while dynamic lighting is enabled. It's also the only means to create maps without loading images.<br />
<br />
== Path Object ==<br />
<br />
{| class="wikitable"<br />
|-<br />
! Property<br />
! Default Value<br />
! Notes<br />
|-<br />
| _id<br />
| <br />
| A unique ID for this object. Globally unique across all objects in this campaign. Read-only.<br />
|-<br />
| _type<br />
| "path"<br />
| Can be used to identify the object type or search for the object. Read-only.<br />
|-<br />
| _pageid<br />
| <br />
| ID of the page the object is in. Read-only.<br />
|-<br />
| _path<br />
|<br />
| A JSON string describing the lines in the path. Read-only. See [[#Path Property|Path Property]] below for more information.<br />
|-<br />
| fill<br />
| "transparent"<br />
| Fill color. Use the string "transparent" of a hex color as a string, for example "#000000"<br />
|-<br />
| stroke<br />
| "#000000"<br />
| Stroke (border) color.<br />
|-<br />
| rotation<br />
| 0<br />
| Rotation (in degrees).<br />
|-<br />
| layer<br />
| ""<br />
| Current layer, one of "gmlayer", "objects", "map", or "walls". The walls layer is used for dynamic lighting, and paths on the walls layer will block light.<br />
|-<br />
| stroke_width<br />
| 5<br />
| Width of the path's line in pixels.<br />
|-<br />
| width<br />
| 0<br />
| Horizontal dimension of the path.<br />
|-<br />
| height<br />
| 0<br />
| Vertical dimension of the path.<br />
|-<br />
| top<br />
| 0<br />
| Y-coordinate for the center of the path<br />
|-<br />
| left<br />
| 0<br />
| X-coordinate for the center of the path<br />
|-<br />
| scaleX<br />
| 1<br />
| Horizontal scale factor for the path.<br />
|-<br />
| scaleY<br />
| 1<br />
| Vertical scale factor for the path.<br />
|-<br />
| controlledby<br />
| ""<br />
| Comma-delimited list of player IDs who can control the path. Controlling players may delete the path. If the path was created by a player, that player is automatically included in the list.<br />
|}<br />
<br />
Most of these properties are either self-explanatory or easy to grasp. It is the <code>_path</code> property, however, which is complicated and requires some further study.<br />
<br />
== Path Property ==<br />
<br />
The <code>_path</code> property is a JSON string, and is a read-only property of the Path object. In order to make use of the <code>_path</code> property, you must use <code>JSON.parse(myPath.get("path"))</code>.<br />
<br />
Once parsed, you'll see that the <code>_path</code> is an array of arrays. Depending on the type of path, the arrays will be different. There are three possible type of paths:<br />
<br />
* Polygon: this includes open polygons, closed polygons, line segments, rectangles, and squares. Squares and rectangles are formed with the "Draw Shape" tool without holding the Alt key. All other polygons are formed with the "Polygon/Line" tool.<br />
* Oval: this includes both ovals and circles. Both are formed with the "Draw Shape" tool while holding the Alt key.<br />
* Freehand: formed with the "Freehand" tool.<br />
<br />
=== Polygonal Paths ===<br />
<br />
Square and rectangle paths are quite easy to read, as they only contain five arrays. Similarly, line segments and polygons with a few sides are not much trouble. All polygonal paths follow the same format: some number of arrays, containing three elements each. The first element of each array is a letter, and the second and third elements form a point.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Array Example<br />
! Description<br />
|-<br />
| <code>["M", 0, 0]</code><br />
| The first point in the polygon. For squares and rectangles, this is the top-left corner. For other polygons, this is the first point you clicked.<br />
|-<br />
| style="white-space:nowrap" | <code>["L", 70, 0]</code><br />
| A point<br />
|-<br />
| colspan="3" | ...<br />
|-<br />
| <code>["L", 0, 70]</code><br />
| A point<br />
|-<br />
| <code>["L", 0, 0]</code><br />
| The final point. If the path is a closed polygon (including squares and rectangles), this point will be equal to the ''M'' point.<br />
|}<br />
<br />
=== Oval Paths ===<br />
<br />
Oval paths are a little bit more complicated. However, every oval path is the same size: five arrays, the first of which contains three elements, and the other four contain seven elements each. The first element of each is a letter, and the remaining six elements each form three points.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Array Example<br />
! Description<br />
|-<br />
| <code>["M", 0, 35]</code><br />
| The midpoint of the left edge of the oval.<br>[[File:Circle Path M.png]]<br />
|-<br />
| <code>["C", 0, 17.5, 17.5, 0, 35, 0]</code><br />
| Three points along the oval's bounding box near the top-left corner.<br>[[File:Circle Path C1.png]]<br />
|-<br />
| <code>["C", 52.5, 0, 70, 17.5, 70, 35]</code><br />
| Three points along the oval's bounding box near the top-right corner.<br>[[File:Circle Path C2.png]]<br />
|-<br />
| style="white-space:nowrap" | <code>["C", 70, 52.5, 52.5, 70, 35, 70]</code><br />
| Three points along the oval's bounding box near the bottom-right corner.<br>[[File:Circle Path C3.png]]<br />
|-<br />
| <code>["C", 17.5, 70, 0, 52.5, 0, 35]</code><br />
| Three points along the oval's bounding box near the bottom-left corner. The third point is equal to the ''M'' point.<br>[[File:Circle Path C4.png]]<br />
|}<br />
<br />
In all of the demonstration images above for the ''C'' arrays, the blue arrow is pointing at the midpoint of the relevant edge of the rectangle. The red and green arrows are pointing at the 1/4 or 3/4 mark of the relevant edges, as appropriate. The red and green arrows are '''not''' pointing at the circle itself.<br />
<br />
=== Freehand Paths ===<br />
<br />
Freehand paths take up the most space, as freehand drawings are -- essentially -- a long poly-line with very short line segments. Like polygons, freehand paths have a variable number of arrays. The first and last array in the path each have three elements: a letter and a point. The arrays between the first and the last have five elements: a letter and two points.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Array Example<br />
! Description<br />
|-<br />
| <code>["M", 0, 44]</code><br />
| The first point.<br />
|-<br />
| <code>["Q", 0, 44, 0.5, 44]</code><br />
| Two points: the previous point in the path, and the current point in the path.<br />
|-<br />
| colspan="3" | ...<br />
|-<br />
| style="white-space:nowrap" | <code>["Q", 366.5, 55, 368, 54.5]</code><br />
| Two points: the previous point in the path, and the current point in the path.<br />
|-<br />
| <code>["L", 369.5, 54]</code><br />
| The final point.<br />
|}<br />
<br />
While the freehand path is essentially a linked list of points, there are occasionally small differences (less than one pixel) between the "current point in the path" of one array and the "previous point in the path" of the next array.<br />
<br />
=== Analyzing Path Values ===<br />
<br />
All points in the <code>_path</code> property are relative to the top-left corner of the path's bounding rectangle. So, a point of <code>0,0</code> is at the top of the path and the left of the path, but that does not necessarily mean the path is at the top-left of the map -- that's taken care of by the <code>top</code> and <code>left</code> properties.<br />
<br />
If you rotate or resize a path after drawing it, the points do '''not''' change. Those changes are accounted for with the <code>rotation</code>, <code>scaleX</code>, and <code>scaleY</code> properties.<br />
<br />
Paths are not necessarily all clockwise or all counterclockwise; you cannot guarantee that any algorithm that cares about winding order will function as desired, not to mention the possibility of complex polygons. Squares and rectangles are clockwise, but there is nothing to distinguish a rectangle from some other arbitrary polygon.<br />
<br />
[[Category:API|Path]]</div>235259