GameMaker: Studio

GameMaker: Studio

View Stats:
Lefty Nov 12, 2016 @ 12:01am
How to replace color of sprite with code
Hello everyone,

Does anyone know how can I replace a certain color X of a sprite to another color Y that I want, using GML?

I don't want to use image_blend, since it will change the entire sprite color, and not only 1 color.
< >
Showing 1-4 of 4 comments
AlexFzk Nov 12, 2016 @ 1:15am 
Learn about shaders

free asset on yoyo marktplace:
https://marketplace.yoyogames.com/assets/2482/hue-shader
Diveyoc Nov 12, 2016 @ 1:42am 
Is just creating different frames with different sprites in your main sprite an option? That way you could just change the sprite image_index with some code when you want to change colors. Unless your sprite is animated, then this is probably out of the question.
I did this with my main player, so that the player can choose from like 8 different colors at the game start menu.
I messed with image blend a little but likewise, didn't get what I wanted.
Lefty Nov 12, 2016 @ 2:13am 
I have found this Asset which makes exactly what I want:

https://marketplace.yoyogames.com/assets/1661/retro-palette-swapper

Thanks all
Diveyoc Nov 12, 2016 @ 7:50am 
Oh ya, I think that's by Pixelated_Pope. He has a few good youtube tutorials as well.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Nov 12, 2016 @ 12:01am
Posts: 4