• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Changing a color

  • Thread starter Jax_the_grey_cat
  • Start date
J

Jax_the_grey_cat

Guest
Hello friends, I have a sprite with some colors, and I was wondering how could I change some of those colors. For example lets say my sprite has green, red, and blue in it. Is there any chance of making GM draw the blue as yellow?

Thank you very much.
 
Z

zendraw

Guest
yes but you wuld need a shader, which wont be that difficult.
it wuld be somthing like if (b) {b=0; g*=2; r*=2};
b/g/r stands for blue green red in the shader script.
so bazically this code is rund for every pixel and you ask if you have blue, double the green and red and nulify blue.
 
J

Jax_the_grey_cat

Guest
yes but you wuld need a shader, which wont be that difficult.
it wuld be somthing like if (b) {b=0; g*=2; r*=2};
b/g/r stands for blue green red in the shader script.
so bazically this code is rund for every pixel and you ask if you have blue, double the green and red and nulify blue.
Amazing, seems exactly what I need, I will read about shaders now in GM to see if I can apply it. Thank you very much
 
Z

zendraw

Guest
you wuld need only the pixel shader, second tab for that. just find some basic tutorial for it, but if i remember correctly you wont do much changes to it, you simply have to know where to put your code, and how to set it up in the game. for setting it up youd need to deactivate the application surface and draw it and handle it manually. which is also not very difficult.
 
Top