Tilengine - The 2D retro graphics engine forum

Full Version: Сhange color pallete in a part of tilemap
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to change color pallete in a part of tilemap to get water effect like in Sonic games?

[attachment=69]
Hi!

First you need to craft the alternative underwater palette using the regular palette as a base, and tweaking its color values with an image editor. Make sure that foreground, background layers and sprites share the same palette, if not, you'll have to craft several underwater palettes (one for each unique regular palette).

Setup a raster effect callback with TLN_SetRasterCallback() with the following cases:
* at line 0 (starting of frame), set regular palette for both layers and sprites (TLN_SetLayerPalette() and TLN_SetSpritePalette())
* at line 164 aprox (where water line starts), set underwater palette for both layers and sprites