<p>Porymap is extensible via scripting capabilities. This allows the user to write custom JavaScript (technically, ECMAScript) files to support enhanced workflows, without having to fork Porymap itself. While the possibilities are endless, some useful examples of scripting might be:</p>
<h2>Custom Scripts Editor<aclass="headerlink"href="#custom-scripts-editor"title="Permalink to this headline">¶</a></h2>
<p>Your custom scripts can be managed with the Custom Scripts Editor accessible under <codeclass="docutils literal notranslate"><spanclass="pre">Options</span><spanclass="pre">-></span><spanclass="pre">Custom</span><spanclass="pre">Scripts...</span></code>.</p>
<dt>At the top there are three basic buttons for managing your scripts:</dt>
<dd><ulclass="first last simple">
<li><aclass="reference internal"href="../_images/button-create.png"><imgalt="button-create"src="../_images/button-create.png"style="height: 24px;"/></a> Opens a prompt to create a new script file, which will be populated with a basic template.</li>
<li><aclass="reference internal"href="../_images/button-load.png"><imgalt="button-load"src="../_images/button-load.png"style="height: 24px;"/></a> Lets you add an existing script file to Porymap that you’ve already created or downloaded from elsewhere.</li>
<li><aclass="reference internal"href="../_images/button-refresh.png"><imgalt="button-refresh"src="../_images/button-refresh.png"style="height: 24px;"/></a> Any edits made to your scripts while Porymap is already open will not be reflected until you select this button.</li>
</ul>
</dd>
</dl>
<p>Below these buttons is a list of all the custom scripts you have loaded for your project. Each entry will have a text box showing the path of the script file. This path can be freely updated, or you can choose a new path with the <aclass="reference internal"href="../_images/folder.png"><imgalt="button-folder"src="../_images/folder.png"style="width: 24px; height: 24px;"/></a> button next to it. The <aclass="reference internal"href="../_images/file_edit.png"><imgalt="button-edit"src="../_images/file_edit.png"style="width: 24px; height: 24px;"/></a> button will open the script file in your default text editor, and the <aclass="reference internal"href="../_images/delete.png"><imgalt="button-remove"src="../_images/delete.png"style="width: 24px; height: 24px;"/></a> button will remove it from the list. The check box to the left of the filepath indicates whether your script should be running. If you’d like to temporarily disable a script you can uncheck this box.</p>
</div>
<divclass="section"id="writing-a-custom-script">
<h2>Writing a Custom Script<aclass="headerlink"href="#writing-a-custom-script"title="Permalink to this headline">¶</a></h2>
<p>Let’s write a custom script that will randomize grass patterns when the user is editing the map. This is useful, since it’s cumbersome to manually add randomness to grass patches. With the custom script, it will happen automatically. Whenever the user paints a grass tile onto the map, the script will overwrite the tile with a random grass tile instead.</p>
<p>First, open the <codeclass="docutils literal notranslate"><spanclass="pre">Options</span><spanclass="pre">-></span><spanclass="pre">Custom</span><spanclass="pre">Scripts...</span></code> window and select the <aclass="reference internal"href="../_images/button-create.png"><imgalt="button-create"src="../_images/button-create.png"style="height: 24px;"/></a> button. This will open a file save prompt; let’s name our new script file <codeclass="docutils literal notranslate"><spanclass="pre">my_script.js</span></code> and save it. We’ve successfully added a new script! We can now see it listed in the editor.</p>
<divclass="figure align-center">
<aclass="reference internal image-reference"href="../_images/new-script.png"><imgalt="Our New Script"src="../_images/new-script.png"style="width: 60%;"/></a>
<p>At the moment our script doesn’t do anything. Let’s select the <aclass="reference internal"href="../_images/file_edit.png"><imgalt="button-edit"src="../_images/file_edit.png"style="width: 24px; height: 24px;"/></a> button to open it and write the actual code that will power the grass-randomizer. Once the script file is open you will notice that there are several empty functions already inside. These are special “callback” functions that will be called automatically for certain events that occur while Porymap is running. We’re interested in the <codeclass="docutils literal notranslate"><spanclass="pre">onBlockChanged()</span></code> callback, since we want our script to take action whenever a user paints a block on the map.</p>
<p>We can leave the rest of the callback functions in here alone, or we can delete them because we’re not using them. Every callback function does not need to be defined in your script. <strong>Note</strong>: For Porymap to be able to execute these callback functions they need to have the <codeclass="docutils literal notranslate"><spanclass="pre">export</span></code> keyword. The rest of the functions in your script do not need this keyword.</p>
<p>In addition to the callbacks, Porymap also supports a scripting API so that the script can interact with Porymap in interesting ways. For example, a script can change a block or add overlay text on the map. Since we want to paint random grass tiles, we’ll be using the <codeclass="docutils literal notranslate"><spanclass="pre">map.setMetatileId()</span></code> function. Let’s fill in the rest of the grass-randomizing code.</p>
<pclass="last"><strong>For pokeemerald/pokeruby users</strong>: We only have 1 regular grass metatile, but if you want to try this script you could replace <codeclass="docutils literal notranslate"><spanclass="pre">const</span><spanclass="pre">grassTiles</span><spanclass="pre">=</span><spanclass="pre">[0x8,</span><spanclass="pre">0x9,</span><spanclass="pre">0x10,</span><spanclass="pre">0x11];</span></code> in the code below with <codeclass="docutils literal notranslate"><spanclass="pre">const</span><spanclass="pre">grassTiles</span><spanclass="pre">=</span><spanclass="pre">[0x1,</span><spanclass="pre">0x4,</span><spanclass="pre">0xD];</span></code> to randomize using tall grass and flowers instead!</p>
<p>Let’s apply our changes by selecting the <aclass="reference internal"href="../_images/button-refresh.png"><imgalt="button-refresh"src="../_images/button-refresh.png"style="height: 24px;"/></a> button. Because we’ve added a new script we’ll be met with this confirmation prompt. Accept this prompt by selecting <codeclass="docutils literal notranslate"><spanclass="pre">YES</span></code>.</p>
<p>The grass-randomizer script above happens implicitly when the user paints on the map. However, other times we probably want to call the custom script on demand. One of the API functions Porymap provides is the ability to trigger scripting functions from the <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span></code> menu, or a keyboard shortcut. To do this, we will usually want to register the action when the project loads. Here is an example script where some custom actions are registered.</p>
<spanclass="nx">utility</span><spanclass="p">.</span><spanclass="nx">registerAction</span><spanclass="p">(</span><spanclass="s2">"applyNightTint"</span><spanclass="p">,</span><spanclass="s2">"View Night Tint"</span><spanclass="p">,</span><spanclass="s2">"T"</span><spanclass="p">)</span>
<p>Then, to trigger the <codeclass="docutils literal notranslate"><spanclass="pre">applyNightTint()</span></code> function, we could either click <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span><spanclass="pre">-></span><spanclass="pre">View</span><spanclass="pre">Night</span><spanclass="pre">Tint</span></code> or use the <codeclass="docutils literal notranslate"><spanclass="pre">T</span></code> keyboard shortcut. <strong>Note</strong>: Like callbacks, functions registered using <codeclass="docutils literal notranslate"><spanclass="pre">utility.registerAction()</span></code> also need the <codeclass="docutils literal notranslate"><spanclass="pre">export</span></code> keyword for Porymap to call them.</p>
<h2>Scripting API<aclass="headerlink"href="#scripting-api"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="callbacks">
<h3>Callbacks<aclass="headerlink"href="#callbacks"title="Permalink to this headline">¶</a></h3>
<dlclass="function">
<dtid="onProjectOpened">
<codeclass="descname">onProjectOpened</code><spanclass="sig-paren">(</span><em>projectPath</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onProjectOpened"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>projectPath</strong> (<em>string</em>) – the directory path of the opened project</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onProjectClosed">
<codeclass="descname">onProjectClosed</code><spanclass="sig-paren">(</span><em>projectPath</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onProjectClosed"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>projectPath</strong> (<em>string</em>) – the directory path of the closed project</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onMapOpened">
<codeclass="descname">onMapOpened</code><spanclass="sig-paren">(</span><em>mapName</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onMapOpened"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>mapName</strong> (<em>string</em>) – the name of the opened map</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBlockChanged">
<codeclass="descname">onBlockChanged</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>prevBlock</em>, <em>newBlock</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBlockChanged"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when a block is changed on the map. For example, this is called when a user paints a new tile or changes the collision property of a block.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>prevBlock</strong> (<em>object</em>) – the block’s state before it was modified. The object’s shape is <codeclass="docutils literal notranslate"><spanclass="pre">{metatileId,</span><spanclass="pre">collision,</span><spanclass="pre">elevation,</span><spanclass="pre">rawValue}</span></code></li>
<li><strong>newBlock</strong> (<em>object</em>) – the block’s new state after it was modified. The object’s shape is <codeclass="docutils literal notranslate"><spanclass="pre">{metatileId,</span><spanclass="pre">collision,</span><spanclass="pre">elevation,</span><spanclass="pre">rawValue}</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBorderMetatileChanged">
<codeclass="descname">onBorderMetatileChanged</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>prevMetatileId</em>, <em>newMetatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBorderMetatileChanged"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>prevMetatileId</strong> (<em>number</em>) – the metatile id of the border block before it was modified</li>
<li><strong>newMetatileId</strong> (<em>number</em>) – the metatile id of the border block after it was modified</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBlockHoverChanged">
<codeclass="descname">onBlockHoverChanged</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBlockHoverChanged"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBlockHoverCleared">
<codeclass="descname">onBlockHoverCleared</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBlockHoverCleared"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">onMapResized</code><spanclass="sig-paren">(</span><em>oldWidth</em>, <em>oldHeight</em>, <em>newWidth</em>, <em>newHeight</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onMapResized"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>oldWidth</strong> (<em>number</em>) – the width of the map before the change</li>
<li><strong>oldHeight</strong> (<em>number</em>) – the height of the map before the change</li>
<li><strong>newWidth</strong> (<em>number</em>) – the width of the map after the change</li>
<li><strong>newHeight</strong> (<em>number</em>) – the height of the map after the change</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBorderResized">
<codeclass="descname">onBorderResized</code><spanclass="sig-paren">(</span><em>oldWidth</em>, <em>oldHeight</em>, <em>newWidth</em>, <em>newHeight</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBorderResized"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>oldWidth</strong> (<em>number</em>) – the width of the border before the change</li>
<li><strong>oldHeight</strong> (<em>number</em>) – the height of the border before the change</li>
<li><strong>newWidth</strong> (<em>number</em>) – the width of the border after the change</li>
<li><strong>newHeight</strong> (<em>number</em>) – the height of the border after the change</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onMapShifted">
<codeclass="descname">onMapShifted</code><spanclass="sig-paren">(</span><em>xDelta</em>, <em>yDelta</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onMapShifted"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>xDelta</strong> (<em>number</em>) – the horizontal change from the shift</li>
<li><strong>yDelta</strong> (<em>number</em>) – the vertical change from the shift</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onTilesetUpdated">
<codeclass="descname">onTilesetUpdated</code><spanclass="sig-paren">(</span><em>tilesetName</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onTilesetUpdated"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tilesetName</strong> (<em>string</em>) – the name of the updated tileset</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onMainTabChanged">
<codeclass="descname">onMainTabChanged</code><spanclass="sig-paren">(</span><em>oldTab</em>, <em>newTab</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onMainTabChanged"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the selected tab in the main tab bar is changed. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Map, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Events, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Header, <codeclass="docutils literal notranslate"><spanclass="pre">3</span></code>: Connections, <codeclass="docutils literal notranslate"><spanclass="pre">4</span></code>: Wild Pokemon).</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>oldTab</strong> (<em>number</em>) – the index of the previously selected tab</li>
<li><strong>newTab</strong> (<em>number</em>) – the index of the newly selected tab</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onMapViewTabChanged">
<codeclass="descname">onMapViewTabChanged</code><spanclass="sig-paren">(</span><em>oldTab</em>, <em>newTab</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onMapViewTabChanged"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the selected tab in the map view tab bar is changed. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Metatiles, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Collision, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Prefabs).</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>oldTab</strong> (<em>number</em>) – the index of the previously selected tab</li>
<li><strong>newTab</strong> (<em>number</em>) – the index of the newly selected tab</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="onBorderVisibilityToggled">
<codeclass="descname">onBorderVisibilityToggled</code><spanclass="sig-paren">(</span><em>visible</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onBorderVisibilityToggled"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getBlock</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBlock"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>metatileId</strong> (<em>number</em>) – the metatile id of the block</li>
<li><strong>collision</strong> (<em>number</em>) – the collision of the block (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> = passable, <codeclass="docutils literal notranslate"><spanclass="pre">1-3</span></code> = impassable)</li>
<li><strong>elevation</strong> (<em>number</em>) – the elevation of the block</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
<dd><p>Sets a block in the currently-opened map. This is an overloaded function that takes the raw value of a block instead of each of the block’s properties individually.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>rawValue</strong> (<em>number</em>) – the 16 bit value of the block. Bits <codeclass="docutils literal notranslate"><spanclass="pre">0-9</span></code> will be the metatile id, bits <codeclass="docutils literal notranslate"><spanclass="pre">10-11</span></code> will be the collision, and bits <codeclass="docutils literal notranslate"><spanclass="pre">12-15</span></code> will be the elevation.</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileId">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileId</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileId"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>metatileId</strong> (<em>number</em>) – the metatile id of the block</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getBorderMetatileId">
<codeclass="descclassname">map.</code><codeclass="descname">getBorderMetatileId</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBorderMetatileId"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>metatileId</strong> (<em>number</em>) – the metatile id of the block</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getCollision">
<codeclass="descclassname">map.</code><codeclass="descname">getCollision</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getCollision"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the collision of a block in the currently-opened map. (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> = passable, <codeclass="docutils literal notranslate"><spanclass="pre">1-3</span></code> = impassable)</p>
<dd><p>Sets the collision of a block in the currently-opened map. (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> = passable, <codeclass="docutils literal notranslate"><spanclass="pre">1-3</span></code> = impassable)</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>collision</strong> (<em>number</em>) – the collision of the block</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getElevation">
<codeclass="descclassname">map.</code><codeclass="descname">getElevation</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getElevation"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – x coordinate of the block</li>
<li><strong>y</strong> (<em>number</em>) – y coordinate of the block</li>
<li><strong>elevation</strong> (<em>number</em>) – the elevation of the block</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setBlocksFromSelection">
<codeclass="descclassname">map.</code><codeclass="descname">setBlocksFromSelection</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setBlocksFromSelection"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – initial x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – initial y coordinate</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.bucketFill">
<codeclass="descclassname">map.</code><codeclass="descname">bucketFill</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>metatileId</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.bucketFill"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – initial x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – initial y coordinate</li>
<li><strong>metatileId</strong> (<em>number</em>) – metatile id to fill</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.bucketFillFromSelection">
<codeclass="descclassname">map.</code><codeclass="descname">bucketFillFromSelection</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.bucketFillFromSelection"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – initial x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – initial y coordinate</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.magicFill">
<codeclass="descclassname">map.</code><codeclass="descname">magicFill</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>metatileId</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.magicFill"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – initial x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – initial y coordinate</li>
<li><strong>metatileId</strong> (<em>number</em>) – metatile id to magic fill</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.magicFillFromSelection">
<codeclass="descclassname">map.</code><codeclass="descname">magicFillFromSelection</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.magicFillFromSelection"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – initial x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – initial y coordinate</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.shift">
<codeclass="descclassname">map.</code><codeclass="descname">shift</code><spanclass="sig-paren">(</span><em>xDelta</em>, <em>yDelta</em>, <em>forceRedraw = true</em>, <em>commitChanges = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.shift"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>xDelta</strong> (<em>number</em>) – number of blocks to shift horizontally</li>
<li><strong>yDelta</strong> (<em>number</em>) – number of blocks to shift vertically</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<li><strong>commitChanges</strong> (<em>boolean</em>) – Commit the changes to the map’s edit/undo history. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. When making many related map edits, it can be useful to set this to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>, and then commit all of them together with <codeclass="docutils literal notranslate"><spanclass="pre">map.commit()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getDimensions">
<codeclass="descclassname">map.</code><codeclass="descname">getDimensions</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getDimensions"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getWidth</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getWidth"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getHeight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getHeight"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getBorderDimensions</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBorderDimensions"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getBorderWidth</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBorderWidth"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getBorderHeight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBorderHeight"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setDimensions</code><spanclass="sig-paren">(</span><em>width</em>, <em>height</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setDimensions"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>width</strong> (<em>number</em>) – width in blocks</li>
<li><strong>height</strong> (<em>number</em>) – height in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setWidth">
<codeclass="descclassname">map.</code><codeclass="descname">setWidth</code><spanclass="sig-paren">(</span><em>width</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setWidth"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>width</strong> (<em>number</em>) – width in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setHeight">
<codeclass="descclassname">map.</code><codeclass="descname">setHeight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setHeight"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>height</strong> (<em>number</em>) – height in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setBorderDimensions">
<codeclass="descclassname">map.</code><codeclass="descname">setBorderDimensions</code><spanclass="sig-paren">(</span><em>width</em>, <em>height</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setBorderDimensions"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the dimensions of the border of the currently-opened map. If the config setting <codeclass="docutils literal notranslate"><spanclass="pre">use_custom_border_size</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> then this does nothing.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>width</strong> (<em>number</em>) – width in blocks</li>
<li><strong>height</strong> (<em>number</em>) – height in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setBorderWidth">
<codeclass="descclassname">map.</code><codeclass="descname">setBorderWidth</code><spanclass="sig-paren">(</span><em>width</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setBorderWidth"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the width of the border of the currently-opened map. If the config setting <codeclass="docutils literal notranslate"><spanclass="pre">use_custom_border_size</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> then this does nothing.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>width</strong> (<em>number</em>) – width in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setBorderHeight">
<codeclass="descclassname">map.</code><codeclass="descname">setBorderHeight</code><spanclass="sig-paren">(</span><em>height</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setBorderHeight"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the height of the border of the currently-opened map. If the config setting <codeclass="docutils literal notranslate"><spanclass="pre">use_custom_border_size</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> then this does nothing.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>height</strong> (<em>number</em>) – height in blocks</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.redraw">
<codeclass="descclassname">map.</code><codeclass="descname">redraw</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.redraw"title="Permalink to this definition">¶</a></dt>
<dd><p>Redraws the entire map area. Useful when delaying map redraws using <codeclass="docutils literal notranslate"><spanclass="pre">forceRedraw</span><spanclass="pre">=</span><spanclass="pre">false</span></code> in certain map editing functions.</p>
<codeclass="descclassname">map.</code><codeclass="descname">commit</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.commit"title="Permalink to this definition">¶</a></dt>
<dd><p>Commits any uncommitted changes to the map’s edit/undo history. Useful when delaying commits using <codeclass="docutils literal notranslate"><spanclass="pre">commitChanges</span><spanclass="pre">=</span><spanclass="pre">false</span></code> in certain map editing functions.</p>
<codeclass="descclassname">map.</code><codeclass="descname">getSong</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSong"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setSong</code><spanclass="sig-paren">(</span><em>song</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSong"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the background song for the currently-opened map. The song name must be one of the names in the “Song” dropdown menu on the Header tab.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>song</strong> (<em>string</em>) – the name of the song</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getLocation">
<codeclass="descclassname">map.</code><codeclass="descname">getLocation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getLocation"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setLocation</code><spanclass="sig-paren">(</span><em>location</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setLocation"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the region map location for the currently-opened map. The location name must be one of the names in the “Location” dropdown menu on the Header tab.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>location</strong> (<em>string</em>) – the name of the location</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getRequiresFlash">
<codeclass="descclassname">map.</code><codeclass="descname">getRequiresFlash</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getRequiresFlash"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setRequiresFlash</code><spanclass="sig-paren">(</span><em>require</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setRequiresFlash"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>require</strong> (<em>boolean</em>) – whether flash should be required</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getWeather">
<codeclass="descclassname">map.</code><codeclass="descname">getWeather</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getWeather"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setWeather</code><spanclass="sig-paren">(</span><em>weather</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setWeather"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the weather for the currently-opened map. The weather name must be one of the names in the “Weather” dropdown menu on the Header tab.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>weather</strong> (<em>string</em>) – the name of the weather</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getType">
<codeclass="descclassname">map.</code><codeclass="descname">getType</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getType"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setType</code><spanclass="sig-paren">(</span><em>type</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setType"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the map type for the currently-opened map. The map type name must be one of the names in the “Type” dropdown menu on the Header tab.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>type</strong> (<em>string</em>) – the name of the map type</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getBattleScene">
<codeclass="descclassname">map.</code><codeclass="descname">getBattleScene</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getBattleScene"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setBattleScene</code><spanclass="sig-paren">(</span><em>battleScene</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setBattleScene"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the battle scene for the currently-opened map. The battle scene name must be one of the names in the “Battle scene” dropdown menu on the Header tab.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>battleScene</strong> (<em>string</em>) – the name of the battle scene</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getShowLocationName">
<codeclass="descclassname">map.</code><codeclass="descname">getShowLocationName</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getShowLocationName"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setShowLocationName</code><spanclass="sig-paren">(</span><em>show</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setShowLocationName"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>show</strong> (<em>boolean</em>) – whether the location name should be shown</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getAllowRunning">
<codeclass="descclassname">map.</code><codeclass="descname">getAllowRunning</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getAllowRunning"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setAllowRunning</code><spanclass="sig-paren">(</span><em>allow</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setAllowRunning"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>allow</strong> (<em>boolean</em>) – whether running should be allowed</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getAllowBiking">
<codeclass="descclassname">map.</code><codeclass="descname">getAllowBiking</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getAllowBiking"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setAllowBiking</code><spanclass="sig-paren">(</span><em>allow</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setAllowBiking"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>allow</strong> (<em>boolean</em>) – whether biking should be allowed</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getAllowEscaping">
<codeclass="descclassname">map.</code><codeclass="descname">getAllowEscaping</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getAllowEscaping"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setAllowEscaping</code><spanclass="sig-paren">(</span><em>allow</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setAllowEscaping"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>allow</strong> (<em>boolean</em>) – whether escaping should be allowed</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getFloorNumber">
<codeclass="descclassname">map.</code><codeclass="descname">getFloorNumber</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getFloorNumber"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setFloorNumber</code><spanclass="sig-paren">(</span><em>floorNumber</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setFloorNumber"title="Permalink to this definition">¶</a></dt>
<p>The following functions are related to tilesets and how they are rendered. The functions with “preview” in their name operate on a “fake” version of the palette colors. This means that changing these “preview” colors won’t affect the actual tileset colors in the project. A good use of the “preview” palettes would be Day/Night tints, for example.</p>
<p>All tileset functions are callable via the global <codeclass="docutils literal notranslate"><spanclass="pre">map</span></code> object.</p>
<codeclass="descclassname">map.</code><codeclass="descname">getPrimaryTileset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getPrimaryTileset"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setPrimaryTileset</code><spanclass="sig-paren">(</span><em>tileset</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setPrimaryTileset"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tileset</strong> (<em>string</em>) – the tileset name</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getSecondaryTileset">
<codeclass="descclassname">map.</code><codeclass="descname">getSecondaryTileset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSecondaryTileset"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setSecondaryTileset</code><spanclass="sig-paren">(</span><em>tileset</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSecondaryTileset"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tileset</strong> (<em>string</em>) – the tileset name</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getNumPrimaryTilesetTiles">
<codeclass="descclassname">map.</code><codeclass="descname">getNumPrimaryTilesetTiles</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getNumPrimaryTilesetTiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getNumSecondaryTilesetTiles</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getNumSecondaryTilesetTiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getNumPrimaryTilesetMetatiles</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getNumPrimaryTilesetMetatiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getNumSecondaryTilesetMetatiles</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getNumSecondaryTilesetMetatiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getPrimaryTilesetPalettePreview</code><spanclass="sig-paren">(</span><em>paletteIndex</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getPrimaryTilesetPalettePreview"title="Permalink to this definition">¶</a></dt>
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">array of colors. Each color is a 3-element RGB array</p>
<codeclass="descclassname">map.</code><codeclass="descname">setPrimaryTilesetPalettePreview</code><spanclass="sig-paren">(</span><em>paletteIndex</em>, <em>colors</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setPrimaryTilesetPalettePreview"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets a palette in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
<li><strong>colors</strong> (<em>array</em>) – array of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palette. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getPrimaryTilesetPalettesPreview">
<codeclass="descclassname">map.</code><codeclass="descname">getPrimaryTilesetPalettesPreview</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getPrimaryTilesetPalettesPreview"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body">array of arrays of colors. Each color is a 3-element RGB array</td>
<codeclass="descclassname">map.</code><codeclass="descname">setPrimaryTilesetPalettesPreview</code><spanclass="sig-paren">(</span><em>palettes</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setPrimaryTilesetPalettesPreview"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all of the palettes in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>palettes</strong> (<em>array</em>) – array of arrays of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palettes. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getSecondaryTilesetPalettePreview">
<codeclass="descclassname">map.</code><codeclass="descname">getSecondaryTilesetPalettePreview</code><spanclass="sig-paren">(</span><em>paletteIndex</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSecondaryTilesetPalettePreview"title="Permalink to this definition">¶</a></dt>
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">array of colors. Each color is a 3-element RGB array</p>
<codeclass="descclassname">map.</code><codeclass="descname">setSecondaryTilesetPalettePreview</code><spanclass="sig-paren">(</span><em>paletteIndex</em>, <em>colors</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSecondaryTilesetPalettePreview"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets a palette in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
<li><strong>colors</strong> (<em>array</em>) – array of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palette. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getSecondaryTilesetPalettesPreview">
<codeclass="descclassname">map.</code><codeclass="descname">getSecondaryTilesetPalettesPreview</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSecondaryTilesetPalettesPreview"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body">array of arrays of colors. Each color is a 3-element RGB array</td>
<codeclass="descclassname">map.</code><codeclass="descname">setSecondaryTilesetPalettesPreview</code><spanclass="sig-paren">(</span><em>palettes</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSecondaryTilesetPalettesPreview"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all of the palettes in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>palettes</strong> (<em>array</em>) – array of arrays of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palettes. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getPrimaryTilesetPalette">
<codeclass="descclassname">map.</code><codeclass="descname">getPrimaryTilesetPalette</code><spanclass="sig-paren">(</span><em>paletteIndex</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getPrimaryTilesetPalette"title="Permalink to this definition">¶</a></dt>
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">array of colors. Each color is a 3-element RGB array</p>
<codeclass="descclassname">map.</code><codeclass="descname">setPrimaryTilesetPalette</code><spanclass="sig-paren">(</span><em>paletteIndex</em>, <em>colors</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setPrimaryTilesetPalette"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
<li><strong>colors</strong> (<em>array</em>) – array of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palette. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getPrimaryTilesetPalettes">
<codeclass="descclassname">map.</code><codeclass="descname">getPrimaryTilesetPalettes</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getPrimaryTilesetPalettes"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body">array of arrays of colors. Each color is a 3-element RGB array</td>
<codeclass="descclassname">map.</code><codeclass="descname">setPrimaryTilesetPalettes</code><spanclass="sig-paren">(</span><em>palettes</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setPrimaryTilesetPalettes"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all of the palettes in the primary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>palettes</strong> (<em>array</em>) – array of arrays of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palettes. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getSecondaryTilesetPalette">
<codeclass="descclassname">map.</code><codeclass="descname">getSecondaryTilesetPalette</code><spanclass="sig-paren">(</span><em>paletteIndex</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSecondaryTilesetPalette"title="Permalink to this definition">¶</a></dt>
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">array of colors. Each color is a 3-element RGB array</p>
<codeclass="descclassname">map.</code><codeclass="descname">setSecondaryTilesetPalette</code><spanclass="sig-paren">(</span><em>paletteIndex</em>, <em>colors</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSecondaryTilesetPalette"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>paletteIndex</strong> (<em>number</em>) – the palette index</li>
<li><strong>colors</strong> (<em>array</em>) – array of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palette. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getSecondaryTilesetPalettes">
<codeclass="descclassname">map.</code><codeclass="descname">getSecondaryTilesetPalettes</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getSecondaryTilesetPalettes"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body">array of arrays of colors. Each color is a 3-element RGB array</td>
<codeclass="descclassname">map.</code><codeclass="descname">setSecondaryTilesetPalettes</code><spanclass="sig-paren">(</span><em>palettes</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setSecondaryTilesetPalettes"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all of the palettes in the secondary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>palettes</strong> (<em>array</em>) – array of arrays of colors. Each color is a 3-element RGB array</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Redraw the elements with the updated palettes. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <codeclass="docutils literal notranslate"><spanclass="pre">redraw</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> on the final call.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileLabel">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileLabel</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileLabel"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileLabel</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>label</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileLabel"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>label</strong> (<em>string</em>) – the label</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileLayerType">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileLayerType</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileLayerType"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the layer type for the specified metatile. <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Middle/Top, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Bottom/Middle, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Bottom/Top.</p>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileLayerType</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>layerType</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileLayerType"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the layer type for the specified metatile. <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Middle/Top, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Bottom/Middle, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Bottom/Top.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>layerType</strong> (<em>number</em>) – the layer type</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileEncounterType">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileEncounterType</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileEncounterType"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the encounter type for the specified metatile. <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: None, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Land, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Water</p>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileEncounterType</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>encounterType</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileEncounterType"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the encounter type for the specified metatile. <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: None, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Land, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Water</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>encounterType</strong> (<em>number</em>) – the encounter type</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileTerrainType">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileTerrainType</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileTerrainType"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileTerrainType</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>terrainType</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileTerrainType"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>terrainType</strong> (<em>number</em>) – the terrain type</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileBehavior">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileBehavior</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileBehavior"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileBehavior</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>behavior</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileBehavior"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileBehaviorName</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileBehaviorName"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the behavior name for the specified metatile. Returns an empty string if the metatile’s behavior value has no name.</p>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileBehaviorName</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>behavior</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileBehaviorName"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the behavior name for the specified metatile. Does nothing if there is no metatile behavior define with the specified name.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileAttributes</code><spanclass="sig-paren">(</span><em>metatileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileAttributes"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileAttributes</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>attributes</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileAttributes"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the raw attributes value for the specified metatile.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this. Porymap will not limit the value of existing attributes to their usual range.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>attributes</strong> (<em>number</em>) – the raw attributes value</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getMetatileTile">
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileTile</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>tileIndex</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileTile"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">map.</code><codeclass="descname">getMetatileTiles</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>tileStart = 0</em>, <em>tileEnd = -1</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getMetatileTiles"title="Permalink to this definition">¶</a></dt>
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>tileStart</strong> (<em>number</em>) – index of the first tile to get. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (the first tile)</li>
<li><strong>tileEnd</strong> (<em>number</em>) – index of the last tile to get. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> (the last tile)</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">array of tiles in the specified range. Each tile is an object of the form <codeclass="docutils literal notranslate"><spanclass="pre">{tileId,</span><spanclass="pre">xflip,</span><spanclass="pre">yflip,</span><spanclass="pre">palette}</span></code></p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>tileIndex</strong> (<em>number</em>) – index of the tile to set</li>
<li><strong>tileId</strong> (<em>number</em>) – new tile’s value</li>
<li><strong>xflip</strong> (<em>boolean</em>) – whether the new tile is flipped horizontally</li>
<li><strong>yflip</strong> (<em>boolean</em>) – whether the new tile is flipped vertically</li>
<li><strong>palette</strong> (<em>number</em>) – new tile’s palette number</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<dd><p>Sets the tile at the specified index of the metatile. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>tileIndex</strong> (<em>number</em>) – index of the tile to set</li>
<li><strong>tile</strong> (<em>object</em>) – the new tile. <codeclass="docutils literal notranslate"><spanclass="pre">tile</span></code> is an object with the properties <codeclass="docutils literal notranslate"><spanclass="pre">{tileId,</span><spanclass="pre">xflip,</span><spanclass="pre">yflip,</span><spanclass="pre">palette}</span></code></li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.setMetatileTiles">
<codeclass="descclassname">map.</code><codeclass="descname">setMetatileTiles</code><spanclass="sig-paren">(</span><em>metatileId</em>, <em>tileId</em>, <em>xflip</em>, <em>yflip</em>, <em>palette</em>, <em>tileStart = 0</em>, <em>tileEnd = -1</em>, <em>forceRedraw = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.setMetatileTiles"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>tileId</strong> (<em>number</em>) – new tiles’ value</li>
<li><strong>xflip</strong> (<em>boolean</em>) – whether the new tiles are flipped horizontally</li>
<li><strong>yflip</strong> (<em>boolean</em>) – whether the new tiles are flipped vertically</li>
<li><strong>palette</strong> (<em>number</em>) – new tiles’ palette number</li>
<li><strong>tileStart</strong> (<em>number</em>) – index of the first tile to set. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (the first tile)</li>
<li><strong>tileEnd</strong> (<em>number</em>) – index of the last tile to set. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> (the last tile)</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
<dd><p>Sets the tiles in the specified range of the metatile. This is an overloaded function that takes an array of tiles as JavaScript objects instead of each of the tile properties individually.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>metatileId</strong> (<em>number</em>) – id of target metatile</li>
<li><strong>tiles</strong> (<em>array</em>) – array of tiles to set. Each tile is an object of the form <codeclass="docutils literal notranslate"><spanclass="pre">{tileId,</span><spanclass="pre">xflip,</span><spanclass="pre">yflip,</span><spanclass="pre">palette}</span></code>. If the array does not have sufficient objects to set all the tiles in the specified range then the remaining tiles will be set with all default values.</li>
<li><strong>tileStart</strong> (<em>number</em>) – index of the first tile to set. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (the first tile)</li>
<li><strong>tileEnd</strong> (<em>number</em>) – index of the last tile to set. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> (the last tile)</li>
<li><strong>forceRedraw</strong> (<em>boolean</em>) – Force the map view to refresh. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Redrawing the map view is expensive, so set to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <codeclass="docutils literal notranslate"><spanclass="pre">map.redraw()</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="map.getTilePixels">
<codeclass="descclassname">map.</code><codeclass="descname">getTilePixels</code><spanclass="sig-paren">(</span><em>tileId</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#map.getTilePixels"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the pixel data for the specified tile. The pixel data is an array of indexes indicating which palette color each pixel uses. Tiles are 8x8, so the pixel array will be 64 elements long.</p>
<p>The following functions are related to an overlay that is drawn on top of the map area. Text, images, and shapes can be drawn using these functions. Items can be drawn and manipulated on separate layers by specifiying a layer id. Items on higher layer ids will be drawn above those on lower layers. The visibility, opacity, position, rotation, and scale of each layer can be changed; by default all layers are visible, have an opacity of <codeclass="docutils literal notranslate"><spanclass="pre">100</span></code>, are at position <codeclass="docutils literal notranslate"><spanclass="pre">0,0</span></code>, an angle of <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>, and a horizontal and vertical scale of <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code>.</p>
<p>All overlay functions are callable via the global <codeclass="docutils literal notranslate"><spanclass="pre">overlay</span></code> object.</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">clear</code><spanclass="sig-paren">(</span><em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.clear"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">hide</code><spanclass="sig-paren">(</span><em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.hide"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">show</code><spanclass="sig-paren">(</span><em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.show"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">getVisibility</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getVisibility"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">setVisibility</code><spanclass="sig-paren">(</span><em>visible</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setVisibility"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>visible</strong> (<em>boolean</em>) – whether the layers should be showing</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.getOpacity">
<codeclass="descclassname">overlay.</code><codeclass="descname">getOpacity</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getOpacity"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the opacity of the specified overlay layer. Opacity ranges from <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (invisible) to <codeclass="docutils literal notranslate"><spanclass="pre">100</span></code> (completely opaque).</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">setOpacity</code><spanclass="sig-paren">(</span><em>opacity</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setOpacity"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the opacity of the specified overlay layer. Opacity ranges from <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (invisible) to <codeclass="docutils literal notranslate"><spanclass="pre">100</span></code> (completely opaque).</p>
<dd><p>This is an overloaded function. Sets the opacity of all active overlay layers. Layers that have not been used yet will not have their opacity changed. Opacity ranges from <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> (invisible) to <codeclass="docutils literal notranslate"><spanclass="pre">100</span></code> (completely opaque).</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>opacity</strong> (<em>number</em>) – the opacity</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.getHorizontalScale">
<codeclass="descclassname">overlay.</code><codeclass="descname">getHorizontalScale</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getHorizontalScale"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the horizontal scale of the specified overlay layer. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">getVerticalScale</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getVerticalScale"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the vertical scale of the specified overlay layer. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">setHorizontalScale</code><spanclass="sig-paren">(</span><em>scale</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setHorizontalScale"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the horizontal scale of the specified overlay layer. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<dd><p>This is an overloaded function. Sets the horizontal scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>scale</strong> (<em>number</em>) – the scale to set</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.setVerticalScale">
<codeclass="descclassname">overlay.</code><codeclass="descname">setVerticalScale</code><spanclass="sig-paren">(</span><em>scale</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setVerticalScale"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the vertical scale of the specified overlay layer. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<dd><p>This is an overloaded function. Sets the vertical scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>scale</strong> (<em>number</em>) – the scale to set</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.setScale">
<codeclass="descclassname">overlay.</code><codeclass="descname">setScale</code><spanclass="sig-paren">(</span><em>hScale</em>, <em>vScale</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setScale"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the horizontal and vertical scale of the specified overlay layer. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<dd><p>This is an overloaded function. Sets the horizontal and vertical scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <codeclass="docutils literal notranslate"><spanclass="pre">1.0</span></code> is normal size.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>hScale</strong> (<em>number</em>) – the horizontal scale to set</li>
<li><strong>vScale</strong> (<em>number</em>) – the vertical scale to set</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.getRotation">
<codeclass="descclassname">overlay.</code><codeclass="descname">getRotation</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getRotation"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">setRotation</code><spanclass="sig-paren">(</span><em>angle</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setRotation"title="Permalink to this definition">¶</a></dt>
<dd><p>This is an overloaded function. Sets the angle that all active overlay layers are rotated to. Layers that have not been used yet will not have their angle changed.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>angle</strong> (<em>number</em>) – the angle to set</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.rotate">
<codeclass="descclassname">overlay.</code><codeclass="descname">rotate</code><spanclass="sig-paren">(</span><em>degrees</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.rotate"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotates the specified overlay layer. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation.</p>
<dd><p>This is an overloaded function. Rotates the all active overlay layers. Layers that have not been used yet will not be rotated. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>degrees</strong> (<em>number</em>) – the number of degrees to rotate</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.getX">
<codeclass="descclassname">overlay.</code><codeclass="descname">getX</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getX"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">getY</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getY"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">overlay.</code><codeclass="descname">setX</code><spanclass="sig-paren">(</span><em>x</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setX"title="Permalink to this definition">¶</a></dt>
<dd><p>This is an overloaded function. Sets the x position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the pixel x coordinate</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.setY">
<codeclass="descclassname">overlay.</code><codeclass="descname">setY</code><spanclass="sig-paren">(</span><em>y</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setY"title="Permalink to this definition">¶</a></dt>
<dd><p>This is an overloaded function. Sets the y position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>y</strong> (<em>number</em>) – the pixel y coordinate</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.setClippingRect">
<codeclass="descclassname">overlay.</code><codeclass="descname">setClippingRect</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>width</em>, <em>height</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setClippingRect"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the rectangular clipping region for the specifieid overlay layer. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is</li>
<li><strong>y</strong> (<em>number</em>) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is</li>
<li><strong>width</strong> (<em>number</em>) – the rectangle’s pixel width</li>
<li><strong>height</strong> (<em>number</em>) – the rectangle’s pixel height</li>
<li><strong>layer</strong> (<em>number</em>) – the layer id</li>
<dd><p>This is an overloaded function. Sets the rectangular clipping region for all overlay layers. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is</li>
<li><strong>y</strong> (<em>number</em>) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is</li>
<li><strong>width</strong> (<em>number</em>) – the rectangle’s pixel width</li>
<li><strong>height</strong> (<em>number</em>) – the rectangle’s pixel height</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.clearClippingRect">
<codeclass="descclassname">overlay.</code><codeclass="descname">clearClippingRect</code><spanclass="sig-paren">(</span><em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.clearClippingRect"title="Permalink to this definition">¶</a></dt>
<dd><p>Clears any clipping for the specified overlay layer. See <codeclass="docutils literal notranslate"><spanclass="pre">setClippingRect</span></code> for more info about clipping.</p>
<dd><p>Clears any clipping for all overlay layers. See <codeclass="docutils literal notranslate"><spanclass="pre">setClippingRect</span></code> for more info about clipping.</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">getPosition</code><spanclass="sig-paren">(</span><em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.getPosition"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the position of the specified overlay layer.</p>
<codeclass="descclassname">overlay.</code><codeclass="descname">setPosition</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.setPosition"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the position of the specified overlay layer.</p>
<dd><p>This is an overloaded function. Sets the position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the pixel x coordinate</li>
<li><strong>y</strong> (<em>number</em>) – the pixel y coordinate</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.move">
<codeclass="descclassname">overlay.</code><codeclass="descname">move</code><spanclass="sig-paren">(</span><em>deltaX</em>, <em>deltaY</em>, <em>layer</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.move"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>deltaX</strong> (<em>number</em>) – the number of pixels to move horizontally</li>
<li><strong>deltaY</strong> (<em>number</em>) – the number of pixels to move vertically</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addText">
<codeclass="descclassname">overlay.</code><codeclass="descname">addText</code><spanclass="sig-paren">(</span><em>text</em>, <em>x</em>, <em>y</em>, <em>color = "#000000"</em>, <em>size = 12</em>, <em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addText"title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a text item to the specified overlay layer. Text can be additionally formatted with a <aclass="reference external"href="https://doc.qt.io/qt-5/richtext-html-subset.html#supported-tags">limited set of HTML tags</a>. Note that only text can be displayed, so text decoration like underlines or table borders will not appear.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>text</strong> (<em>string</em>) – the text to display</li>
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the text (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the text (relative to the layer’s position)</li>
<li><strong>color</strong> (<em>string</em>) – the color of the text. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to black.</li>
<li><strong>size</strong> (<em>number</em>) – the font size of the text. Defaults to 12.</li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addRect">
<codeclass="descclassname">overlay.</code><codeclass="descname">addRect</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>width</em>, <em>height</em>, <em>borderColor = "#000000"</em>, <em>fillColor = ""</em>, <em>rounding = 0</em>, <em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addRect"title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a rectangle outline item to the specified overlay layer.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position)</li>
<li><strong>width</strong> (<em>number</em>) – the pixel width of the rectangle</li>
<li><strong>height</strong> (<em>number</em>) – the pixel height of the rectangle</li>
<li><strong>borderColor</strong> (<em>string</em>) – the color of the rectangle’s border. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to black.</li>
<li><strong>fillColor</strong> (<em>string</em>) – the color of the area enclosed by the rectangle. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to transparent.</li>
<li><strong>rounding</strong> (<em>number</em>) – the percent degree the corners will be rounded. <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> is rectangular, <codeclass="docutils literal notranslate"><spanclass="pre">100</span></code> is elliptical. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addPath">
<codeclass="descclassname">overlay.</code><codeclass="descname">addPath</code><spanclass="sig-paren">(</span><em>coords</em>, <em>borderColor = "#000000"</em>, <em>fillColor = ""</em>, <em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addPath"title="Permalink to this definition">¶</a></dt>
<dd><p>Draws a straight path on the specified layer by connecting the coordinate pairs in <codeclass="docutils literal notranslate"><spanclass="pre">coords</span></code>. The area enclosed by the path can be colored in, and will follow the <aclass="reference external"href="https://doc.qt.io/qt-5/qt.html#FillRule-enum">“odd-even” fill rule</a>.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>coords</strong> (<em>array</em>) – array of pixel coordinates to connect to create the path. Each element of the array should be an array containing an x and y pixel coordinate</li>
<li><strong>borderColor</strong> (<em>string</em>) – the color of the path. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to black.</li>
<li><strong>fillColor</strong> (<em>string</em>) – the color of the area enclosed by the path. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to transparent.</li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<dd><p>This is an overloaded function. Draws a straight path on the specified layer by connecting the coordinates at (<codeclass="docutils literal notranslate"><spanclass="pre">xCoords</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">yCoords</span></code>). The area enclosed by the path can be colored in, and will follow the <aclass="reference external"href="https://doc.qt.io/qt-5/qt.html#FillRule-enum">“odd-even” fill rule</a>.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>xCoords</strong> (<em>array</em>) – array of x pixel coordinates to connect to create the path</li>
<li><strong>yCoords</strong> (<em>array</em>) – array of y pixel coordinates to connect to create the path</li>
<li><strong>borderColor</strong> (<em>string</em>) – the color of the path. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to black.</li>
<li><strong>fillColor</strong> (<em>string</em>) – the color of the area enclosed by the path. Can be specified as <codeclass="docutils literal notranslate"><spanclass="pre">"#RRGGBB"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"#AARRGGBB"</span></code>. Defaults to transparent.</li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addImage">
<codeclass="descclassname">overlay.</code><codeclass="descname">addImage</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>filepath</em>, <em>layer = 0</em>, <em>useCache = true</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addImage"title="Permalink to this definition">¶</a></dt>
<dd><p>Adds an image item to the specified overlay layer.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>filepath</strong> (<em>string</em>) – the image’s filepath</li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>useCache</strong> (<em>boolean</em>) – whether the image should be saved/loaded using the cache. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Reading images from a file is slow. Setting <codeclass="docutils literal notranslate"><spanclass="pre">useCache</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.</li>
<dd><p>Creates an image item on the specified overlay layer. This differs from <codeclass="docutils literal notranslate"><spanclass="pre">overlay.addImage</span></code> by allowing the new image to be a transformation of the image file.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>filepath</strong> (<em>string</em>) – the image’s filepath</li>
<li><strong>width</strong> (<em>number</em>) – the width in pixels of the area to read in the image. If <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code>, use the full width of the original image. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code></li>
<li><strong>height</strong> (<em>number</em>) – the height in pixels of the area to read in the image. If <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code>, use the full height of the original image. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code></li>
<li><strong>xOffset</strong> (<em>number</em>) – the x pixel coordinate on the original image where data should be read from. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>yOffset</strong> (<em>number</em>) – the y pixel coordinate on the original image where data should be read from. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>hScale</strong> (<em>number</em>) – the horizontal scale for the image. Negative values will be a horizontal flip of the original image. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code></li>
<li><strong>vScale</strong> (<em>number</em>) – the vertical scale for the image. Negative values will be a vertical flip of the original image. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code></li>
<li><strong>paletteId</strong> (<em>number</em>) – the id of which currently loaded tileset palette to use for the image. If <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code>, use the original image’s palette. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code></li>
<li><strong>setTransparency</strong> (<em>boolean</em>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code></li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>useCache</strong> (<em>boolean</em>) – whether the image should be saved/loaded using the cache. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>. Reading images from a file is slow. Setting <codeclass="docutils literal notranslate"><spanclass="pre">useCache</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addTileImage">
<codeclass="descclassname">overlay.</code><codeclass="descname">addTileImage</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>tileId</em>, <em>xflip</em>, <em>yflip</em>, <em>palette</em>, <em>setTransparency = false</em>, <em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addTileImage"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>tileId</strong> (<em>number</em>) – tile value for the image</li>
<li><strong>xflip</strong> (<em>boolean</em>) – whether the tile image is flipped horizontally</li>
<li><strong>yflip</strong> (<em>boolean</em>) – whether the tile image is flipped vertically</li>
<li><strong>palette</strong> (<em>number</em>) – palette number for the tile image</li>
<li><strong>setTransparency</strong> (<em>boolean</em>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code></li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<dd><p>Creates an image of a tile on the specified overlay layer. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>tile</strong> (<em>object</em>) – the tile to create an image of. <codeclass="docutils literal notranslate"><spanclass="pre">tile</span></code> is an object with the properties <codeclass="docutils literal notranslate"><spanclass="pre">{tileId,</span><spanclass="pre">xflip,</span><spanclass="pre">yflip,</span><spanclass="pre">palette}</span></code></li>
<li><strong>setTransparency</strong> (<em>boolean</em>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code></li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="overlay.addMetatileImage">
<codeclass="descclassname">overlay.</code><codeclass="descname">addMetatileImage</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>metatileId</em>, <em>setTransparency = false</em>, <em>layer = 0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#overlay.addMetatileImage"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>x</strong> (<em>number</em>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>y</strong> (<em>number</em>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</li>
<li><strong>metatileId</strong> (<em>number</em>) – id of the metatile to create an image of</li>
<li><strong>setTransparency</strong> (<em>boolean</em>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code></li>
<li><strong>layer</strong> (<em>number</em>) – the layer id. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<codeclass="descclassname">utility.</code><codeclass="descname">getGridVisibility</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getGridVisibility"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">setGridVisibility</code><spanclass="sig-paren">(</span><em>visible</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setGridVisibility"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getBorderVisibility</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getBorderVisibility"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">setBorderVisibility</code><spanclass="sig-paren">(</span><em>visible</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setBorderVisibility"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getSmartPathsEnabled</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getSmartPathsEnabled"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">setSmartPathsEnabled</code><spanclass="sig-paren">(</span><em>enabled</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setSmartPathsEnabled"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getCustomScripts</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getCustomScripts"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getMainTab</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMainTab"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the index of the currently selected main tab. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Map, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Events, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Header, <codeclass="docutils literal notranslate"><spanclass="pre">3</span></code>: Connections, <codeclass="docutils literal notranslate"><spanclass="pre">4</span></code>: Wild Pokemon).</p>
<codeclass="descclassname">utility.</code><codeclass="descname">setMainTab</code><spanclass="sig-paren">(</span><em>tab</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setMainTab"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the currently selected main tab. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Map, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Events, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Header, <codeclass="docutils literal notranslate"><spanclass="pre">3</span></code>: Connections, <codeclass="docutils literal notranslate"><spanclass="pre">4</span></code>: Wild Pokemon).</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tab</strong> (<em>number</em>) – index of the tab to select</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.getMapViewTab">
<codeclass="descclassname">utility.</code><codeclass="descname">getMapViewTab</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMapViewTab"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the index of the currently selected map view tab. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Metatiles, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Collision, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Prefabs).</p>
<codeclass="descclassname">utility.</code><codeclass="descname">setMapViewTab</code><spanclass="sig-paren">(</span><em>tab</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setMapViewTab"title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the currently selected map view tab. Tabs are indexed from left to right, starting at 0 (<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>: Metatiles, <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>: Collision, <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>: Prefabs).</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>tab</strong> (<em>number</em>) – index of the tab to select</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.getMetatileLayerOrder">
<codeclass="descclassname">utility.</code><codeclass="descname">getMetatileLayerOrder</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMetatileLayerOrder"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">setMetatileLayerOrder</code><spanclass="sig-paren">(</span><em>order</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setMetatileLayerOrder"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>order</strong> (<em>array</em>) – array of layers. The bottom layer is represented as 0.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.getMetatileLayerOpacity">
<codeclass="descclassname">utility.</code><codeclass="descname">getMetatileLayerOpacity</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMetatileLayerOpacity"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body">array of opacities for each layer. The bottom layer is the first element.</td>
<codeclass="descclassname">utility.</code><codeclass="descname">setMetatileLayerOpacity</code><spanclass="sig-paren">(</span><em>opacities</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setMetatileLayerOpacity"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">registerAction</code><spanclass="sig-paren">(</span><em>functionName</em>, <em>actionName</em>, <em>shortcut = ""</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.registerAction"title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a JavaScript function to an action that can be manually triggered in Porymap’s <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span></code> menu. Optionally, a keyboard shortcut (e.g. <codeclass="docutils literal notranslate"><spanclass="pre">"Ctrl+P"</span></code>) can also be specified, assuming it doesn’t collide with any existing shortcuts used by Porymap. The function specified by <codeclass="docutils literal notranslate"><spanclass="pre">functionName</span></code> must have the <codeclass="docutils literal notranslate"><spanclass="pre">export</span></code> keyword.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>functionName</strong> (<em>string</em>) – name of the JavaScript function</li>
<li><strong>actionName</strong> (<em>string</em>) – name of the action that will be displayed in the <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span></code> menu</li>
<dd><p>Registers a JavaScript function to an action that can be manually triggered in Porymap’s <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span></code> menu. Optionally, a keyboard shortcut (e.g. <codeclass="docutils literal notranslate"><spanclass="pre">"Ctrl+P"</span></code>) can also be specified, assuming it doesn’t collide with any existing shortcuts used by Porymap. A check mark will be toggled next to the action name each time its activated. Whether the check mark is initially present can be set with <codeclass="docutils literal notranslate"><spanclass="pre">checked</span></code>. The function specified by <codeclass="docutils literal notranslate"><spanclass="pre">functionName</span></code> must have the <codeclass="docutils literal notranslate"><spanclass="pre">export</span></code> keyword.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>functionName</strong> (<em>string</em>) – name of the JavaScript function</li>
<li><strong>actionName</strong> (<em>string</em>) – name of the action that will be displayed in the <codeclass="docutils literal notranslate"><spanclass="pre">Tools</span></code> menu</li>
<li><strong>checked</strong> (<em>boolean</em>) – whether the action initially has a check mark. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.setTimeout">
<codeclass="descclassname">utility.</code><codeclass="descname">setTimeout</code><spanclass="sig-paren">(</span><em>func</em>, <em>delayMs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.setTimeout"title="Permalink to this definition">¶</a></dt>
<dd><p>This behaves essentially the same as JavaScript’s <codeclass="docutils literal notranslate"><spanclass="pre">setTimeout()</span></code> that is used in web browsers or NodeJS. The <codeclass="docutils literal notranslate"><spanclass="pre">func</span></code> argument is a JavaScript function (NOT the name of a function) which will be executed after a delay. This is useful for creating animations or refreshing the overlay at constant intervals.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>func</strong> (<em>function</em>) – a JavaScript function that will be executed later</li>
<li><strong>delayMs</strong> (<em>number</em>) – the number of milliseconds to wait before executing <codeclass="docutils literal notranslate"><spanclass="pre">func</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.log">
<codeclass="descclassname">utility.</code><codeclass="descname">log</code><spanclass="sig-paren">(</span><em>message</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.log"title="Permalink to this definition">¶</a></dt>
<dd><p>Logs a message to the Porymap log file with the prefix <codeclass="docutils literal notranslate"><spanclass="pre">[INFO]</span></code>. This is useful for debugging custom scripts.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>message</strong> (<em>string</em>) – the message to log</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.warn">
<codeclass="descclassname">utility.</code><codeclass="descname">warn</code><spanclass="sig-paren">(</span><em>message</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.warn"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>message</strong> (<em>string</em>) – the message to log</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.error">
<codeclass="descclassname">utility.</code><codeclass="descname">error</code><spanclass="sig-paren">(</span><em>message</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.error"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>message</strong> (<em>string</em>) – the message to log</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.showMessage">
<codeclass="descclassname">utility.</code><codeclass="descname">showMessage</code><spanclass="sig-paren">(</span><em>text</em>, <em>informativeText</em>, <em>detailedText</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.showMessage"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a message box with an “Information” icon and an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> button. Execution stops while the window is open.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>text</strong> (<em>string</em>) – the main message text</li>
<li><strong>informativeText</strong> (<em>string</em>) – smaller text below the main message. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
<li><strong>detailedText</strong> (<em>string</em>) – text hidden behind a “Show Details” box. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.showWarning">
<codeclass="descclassname">utility.</code><codeclass="descname">showWarning</code><spanclass="sig-paren">(</span><em>text</em>, <em>informativeText</em>, <em>detailedText</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.showWarning"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a message box with a “Warning” icon and an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> button. Execution stops while the window is open.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>text</strong> (<em>string</em>) – the main message text</li>
<li><strong>informativeText</strong> (<em>string</em>) – smaller text below the main message. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
<li><strong>detailedText</strong> (<em>string</em>) – text hidden behind a “Show Details” box. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.showError">
<codeclass="descclassname">utility.</code><codeclass="descname">showError</code><spanclass="sig-paren">(</span><em>text</em>, <em>informativeText</em>, <em>detailedText</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.showError"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a message box with a “Critical” icon and an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> button. Execution stops while the window is open.</p>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>text</strong> (<em>string</em>) – the main message text</li>
<li><strong>informativeText</strong> (<em>string</em>) – smaller text below the main message. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
<li><strong>detailedText</strong> (<em>string</em>) – text hidden behind a “Show Details” box. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="utility.showQuestion">
<codeclass="descclassname">utility.</code><codeclass="descname">showQuestion</code><spanclass="sig-paren">(</span><em>text</em>, <em>informativeText</em>, <em>detailedText</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.showQuestion"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a message box with a “Question” icon and a <codeclass="docutils literal notranslate"><spanclass="pre">Yes</span></code> and a <codeclass="docutils literal notranslate"><spanclass="pre">No</span></code> button. Execution stops while the window is open.</p>
<li><strong>text</strong> (<em>string</em>) – the main message text</li>
<li><strong>informativeText</strong> (<em>string</em>) – smaller text below the main message. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
<li><strong>detailedText</strong> (<em>string</em>) – text hidden behind a “Show Details” box. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">Yes</span></code> was selected, <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">No</span></code> was selected or if the window was closed without selection</p>
<codeclass="descclassname">utility.</code><codeclass="descname">getInputText</code><spanclass="sig-paren">(</span><em>title</em>, <em>label</em>, <em>default</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getInputText"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a text input dialog with an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> and a <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<li><strong>title</strong> (<em>string</em>) – the text in the window title bar</li>
<li><strong>label</strong> (<em>string</em>) – the text adjacent to the input entry area</li>
<li><strong>default</strong> (<em>string</em>) – the text in the input entry area when the window is opened. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code></li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be the input text and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> was selected. <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">""</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
<codeclass="descclassname">utility.</code><codeclass="descname">getInputNumber</code><spanclass="sig-paren">(</span><em>title</em>, <em>label</em>, <em>default</em>, <em>min</em>, <em>max</em>, <em>decimals</em>, <em>step</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getInputNumber"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a number input dialog with an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> and a <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<li><strong>title</strong> (<em>string</em>) – the text in the window title bar</li>
<li><strong>label</strong> (<em>string</em>) – the text adjacent to the input entry area</li>
<li><strong>default</strong> (<em>number</em>) – the number in the input entry area when the window is opened. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>min</strong> (<em>number</em>) – the minimum allowable input value. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">-2147483648</span></code></li>
<li><strong>max</strong> (<em>number</em>) – the maximum allowable input value. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">2147483647</span></code></li>
<li><strong>decimals</strong> (<em>number</em>) – the number of decimals used for the input number. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>step</strong> (<em>number</em>) – the increment by which the input number will change when the spinner is used. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code></li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be the input number and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> was selected. <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">default</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
<codeclass="descclassname">utility.</code><codeclass="descname">getInputItem</code><spanclass="sig-paren">(</span><em>title</em>, <em>label</em>, <em>items</em>, <em>default</em>, <em>editable</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getInputItem"title="Permalink to this definition">¶</a></dt>
<dd><p>Displays a text input dialog with an items dropdown and an <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> and a <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<li><strong>title</strong> (<em>string</em>) – the text in the window title bar</li>
<li><strong>label</strong> (<em>string</em>) – the text adjacent to the input entry area</li>
<li><strong>items</strong> (<em>array</em>) – an array of text items that will populate the dropdown</li>
<li><strong>default</strong> (<em>number</em>) – the index of the item to select by default. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code></li>
<li><strong>editable</strong> (<em>boolean</em>) – whether the user is allowed to enter their own text instead. Defaults to <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code></li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be the input text and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">true</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">OK</span></code> was selected. <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> will be the text of the item at <codeclass="docutils literal notranslate"><spanclass="pre">default</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">ok</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">false</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
<codeclass="descclassname">utility.</code><codeclass="descname">getMapNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMapNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getTilesetNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getTilesetNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getPrimaryTilesetNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getPrimaryTilesetNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getSecondaryTilesetNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getSecondaryTilesetNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getMetatileBehaviorNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMetatileBehaviorNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getSongNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getSongNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getLocationNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getLocationNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getWeatherNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getWeatherNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getMapTypeNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getMapTypeNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">getBattleSceneNames</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.getBattleSceneNames"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">isPrimaryTileset</code><spanclass="sig-paren">(</span><em>tilesetName</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.isPrimaryTileset"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">utility.</code><codeclass="descname">isSecondaryTileset</code><spanclass="sig-paren">(</span><em>tilesetName</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#utility.isSecondaryTileset"title="Permalink to this definition">¶</a></dt>
<p>Some constant values are provided for convenience. These are read-only properties guaranteed not to change unless a new project is opened or the current one is reloaded.</p>
<p>All constants are accessible via the global <codeclass="docutils literal notranslate"><spanclass="pre">constants</span></code> object.</p>
<codeclass="descclassname">constants.</code><codeclass="descname">max_primary_tiles</code><aclass="headerlink"href="#constants.max_primary_tiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">constants.</code><codeclass="descname">max_secondary_tiles</code><aclass="headerlink"href="#constants.max_secondary_tiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">constants.</code><codeclass="descname">max_primary_metatiles</code><aclass="headerlink"href="#constants.max_primary_metatiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">constants.</code><codeclass="descname">max_secondary_metatiles</code><aclass="headerlink"href="#constants.max_secondary_metatiles"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">constants.</code><codeclass="descname">num_primary_palettes</code><aclass="headerlink"href="#constants.num_primary_palettes"title="Permalink to this definition">¶</a></dt>
<dd><p>The number of palettes in a primary tileset.</p>
</dd></dl>
<dlclass="attribute">
<dtid="constants.num_secondary_palettes">
<codeclass="descclassname">constants.</code><codeclass="descname">num_secondary_palettes</code><aclass="headerlink"href="#constants.num_secondary_palettes"title="Permalink to this definition">¶</a></dt>
<dd><p>The number of palettes in a secondary tileset.</p>
<codeclass="descclassname">constants.</code><codeclass="descname">layers_per_metatile</code><aclass="headerlink"href="#constants.layers_per_metatile"title="Permalink to this definition">¶</a></dt>
<dd><p>The number of tile layers used in each metatile. This will either be <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">3</span></code>, depending on the config setting <codeclass="docutils literal notranslate"><spanclass="pre">enable_triple_layer_metatiles</span></code>.</p>
<codeclass="descclassname">constants.</code><codeclass="descname">tiles_per_metatile</code><aclass="headerlink"href="#constants.tiles_per_metatile"title="Permalink to this definition">¶</a></dt>
<dd><p>The number of tiles in each metatile. This will either be <codeclass="docutils literal notranslate"><spanclass="pre">8</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">12</span></code>, depending on the config setting <codeclass="docutils literal notranslate"><spanclass="pre">enable_triple_layer_metatiles</span></code>.</p>
<codeclass="descclassname">constants.</code><codeclass="descname">metatile_behaviors</code><aclass="headerlink"href="#constants.metatile_behaviors"title="Permalink to this definition">¶</a></dt>
<dd><p>An object mapping metatile behavior names to their values. For example, <codeclass="docutils literal notranslate"><spanclass="pre">constants.metatile_behaviors["MB_TALL_GRASS"]</span></code> would normally be <codeclass="docutils literal notranslate"><spanclass="pre">2</span></code>.</p>
<codeclass="descclassname">constants.</code><codeclass="descname">base_game_version</code><aclass="headerlink"href="#constants.base_game_version"title="Permalink to this definition">¶</a></dt>
<dd><p>The string value of the config setting <codeclass="docutils literal notranslate"><spanclass="pre">base_game_version</span></code>. This will either be <codeclass="docutils literal notranslate"><spanclass="pre">pokeruby</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">pokefirered</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">pokeemerald</span></code>.</p>
<codeclass="descclassname">constants.version.</code><codeclass="descname">major</code><aclass="headerlink"href="#constants.version.major"title="Permalink to this definition">¶</a></dt>
<dd><p>Porymap’s major version number. For example, for Porymap version <codeclass="docutils literal notranslate"><spanclass="pre">5.1.0</span></code> this will be <codeclass="docutils literal notranslate"><spanclass="pre">5</span></code>.</p>
<codeclass="descclassname">constants.version.</code><codeclass="descname">minor</code><aclass="headerlink"href="#constants.version.minor"title="Permalink to this definition">¶</a></dt>
<dd><p>Porymap’s minor version number. For example, for Porymap version <codeclass="docutils literal notranslate"><spanclass="pre">5.1.0</span></code> this will be <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>.</p>
<codeclass="descclassname">constants.version.</code><codeclass="descname">patch</code><aclass="headerlink"href="#constants.version.patch"title="Permalink to this definition">¶</a></dt>
<dd><p>Porymap’s patch version number. For example, for Porymap version <codeclass="docutils literal notranslate"><spanclass="pre">5.1.0</span></code> this will be <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code>.</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.