-
Notifications
You must be signed in to change notification settings - Fork 1
Example Usage
Lojemiru edited this page Jul 10, 2022
·
1 revision
To get started, create a palette sprite with the Palette Builder.
After you've created that sprite and added it to your project file (in this example as sprPalette
), you will need to do the following:
- Run chameleon_init() at the start of the game.
- Add chameleon_set() to the draw event of the object you want to recolor.
The usage of chameleon_set()
should look something like this:
///@desc Draw event
chameleon_set(sprPalette);
draw_self();
// Must be called after you're done drawing the recolored object!
shader_reset();
If you have multiple frames in a palette sprite, you can pass in an integer to tell Chameleon which one to use:
///@desc Draw event
chameleon_set(sprPalette, 2);
draw_self();
// Must be called after you're done drawing the recolored object!
shader_reset();
If you wish to partially blend the original colors and the new palette, you can pass in a value between 0 and 1 as the mix argument:
///@desc Draw event
chameleon_set(sprPalette, 2, 0.5);
draw_self();
// Must be called after you're done drawing the recolored object!
shader_reset();