Tilengine 2.14: new SNES-style layer window


Release 2.14 of Tilengine adds a new layer window feature, based on the actual SNES hardware.

This feature extends original layer clipping that was already implemented in Tilengine. However, layer windowing is much more powerful:

  • can be set to normal o inverse: instead of clipping the outside, it clips the inside
  • color math with clipped region: the cut-out region can be set to one of three modes:
    • transparent: by default, the underlying layer can be seen where the upper layer is cut (same as classic layer clip)
    • solid color: the masked region can be filled with a constant color
    • color math: the masked region is set to one of available color blending modes, combining a solid color and the underlying layer

New example LayerWindow (https://github.com/megamarc/Tilengine/blob/master/samples/LayerWindow.c) allows to play with combinations of features:

  • Outside clipping, shows the underlying layer. Equivalent to classic "layer clipping"

  • Inverse clipping  (clips the inside) with blue color applied with blending function to the inner hole


Using raster effects to modify the window edges on each scaline allows free-form clipping, the same trick used in Super Mario World where a circle and keyhole shapes scaled up and down to create a transition between layers.

These screenshots from new sample LayerCircle (https://github.com/megamarc/Tilengine/blob/master/samples/LayerCircle.c) allow moving a circle and change its radius to mask the main layer, filling the outside part with blue:



Files

Windows 64-bit 786 kB
Feb 10, 2023
Windows 32-bit 764 kB
Feb 10, 2023
Linux ARMv7l (Raspberry Pi, BeagleBone...) 687 kB
Feb 10, 2023
Linux Desktop 32-bit 705 kB
Feb 10, 2023
Linux Desktop 64-bit 698 kB
Feb 10, 2023

Get Tilengine

Buy Now$5.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.