Skip to content

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:

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();
Clone this wiki locally