diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b88eae..1210977c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ## [Unreleased] ### Added - Add ability to set the opacity of the scripting overlay. -- Add ability to get/set map header properties via the API. +- Add ability to get/set map header properties and read tile pixel data via the API. ### Changed - If an object event is inanimate, it will always render using its first frame. diff --git a/docsrc/manual/scripting-capabilities.rst b/docsrc/manual/scripting-capabilities.rst index 091ca94a..cc1ab097 100644 --- a/docsrc/manual/scripting-capabilities.rst +++ b/docsrc/manual/scripting-capabilities.rst @@ -1114,7 +1114,11 @@ The following functions are related to tilesets and how they are rendered. The f :param number tileEnd: index of the last tile to set. Defaults to ``-1`` (the last tile) :param boolean forceRedraw: Force the map view to refresh. Defaults to ``true``. Redrawing the map view is expensive, so set to ``false`` when making many consecutive map edits, and then redraw the map once using ``map.redraw()``. +..js:function:: map.getTilePixels(tileId) + Gets the pixel data for the specified tile. The pixel data is an array of numbers indicating which palette color each pixel uses. Tiles are 8x8, so the pixel array will be 64 elements long. + + :returns array: the pixel data Settings Functions ^^^^^^^^^^^^^^^^^^