Script Layer Type

Add the ability to assign a script per-layer to programmatically and non-destructively change the layer value during rendering.
Either a dedicated Script Layer type which can contain other layers like a Group Layer or an additional layer property so that any layer type can contain a script.
Lua is probably too slow to do anything too complex, but simple things should be doable.

Script Entry Points:

  • Pre-render: perform any expensive precomputations here
  • Per-tile (tilemap only): takes the layer tile value and returns the script modified value
  • Per-pixel: takes the current pixel’s composition result and layer pixel value and returns the script modified value
  • Gui: optionally launch a script settings dialog

Usage examples:

  • Use on an extra Tilemap Layer for per-tile colour offset into subpalettes like NES the palette attribute table (can do this in Pro Motion with a layer effect)
  • Similarly use for material mapping, grey scale to multiple colour ramps
  • Autotiling by modifying tile value based on neighbours