GML How to change color palette of image in gml?

D

Deleted User

Guest
Hello.

I have a lot of creatures in the game that use same sprites, but the color palettes are different based on level etc like that.

example of 2 palettes, both are same sprite, but different colours:
palette_example.png

i want to define something like this on creature create event to change the colours:
GML:
npc_palette = palette1; //would accept palette2, palette3.... etc
Is there anyway to do this in gml?
i could do it by copying all the sprites and changing the palettes manually on photoshop, but that is thousands of sprites (and probably thousand of wasted hours :D )... there must be easier way.
 
D

Deleted User

Guest
No efficient way of doing it purely using GML. Shaders + GML (and preperation) are perfectly suited for this though!


Maybe this shader is better suited for full palette swaps:

that could be one solution, very nice.

i have only 64 colours used in total on my sprites so it wont be a huge task to make some kind of custom gml function for this using that shader.
 
Top