A series of functions which allow for storing numerous tints, and toggling them each individually on/off.
Also contains the ability to gradually transition from one tint to another over time.
Changelog:
V1.01 (22-Jul-2019)
Some slight internal changes
Added `getBase()`, to return the current base.
Bases now use an enum type `Base`, instead of `int`.
V1.02 (03-Sep-2019)
Added tinting DMaps
V1.03 (31-May-2021)
Changed flags to long, added constant assert
Only requires std.zh
3 scripts must be set up:
In a `global script Init`, include a call to `TintZH::tintInit();`
In a `global script onContinue`, include a call to `TintZH::tintOnContinue();`
In your global active script, before Waitdraw(), call `TintZH::runTints()`
To use:
Create a tint palette by calling `TintZH::createTintPalette(r,g,b)`. This returns an index, which is how you will reference the tint from that point on.
To simply toggle these on/off, use `setTint(index, true/false)`. You can check the current state with `tintIsActive(index)`.
`changeBase(int base)` allows you to change between tinted or either monochrome option. (Use the BASE_ constants in the header)
Gradients can be done using `runGradient`, taking either a start RGB and end RGB, or start tint index and end tint index.
DMap tinting: 'tintDMap(int dmap, r, g, b, Base)' to give it a direct tint, or 'tintDMap(int dmap, tintIndex, Base)' to use a tint palette you created with 'createTintPalette()' for the dmap.
Notes:
Tint index 0 is defined as `TINT_GREYSCALE`, with RGB of `0,0,0`. With base BASE_NONE, this is blank, otherwise it will be greyscale.
If you are having issues for any reason, changing the `DEBUG` constant to `true` will cause debug info to be logged.
Further detail is included in the comments prior to each function.
Performance note: When using gradients, updating every frame is recommended for smoothness of gradient, though if you have performance issues with this, you can increase the `GRADIENT_RATE` constant to slow this down.