SDL Bitmap Color Recolering help
Im making text for a chat log, and i have tried several methods(which none work) and i was wondering if there was any way, after you load a bitmap SDL_Surface, if you could replace all of a certain color with another color. Like if a friendly npc chats, his name will be shown in green, but if a enemy npc chats, his name will be shown in red. is there any SDL function/method that would be able to change all color A into color B, and if not, what should i do?
You should get all the sub-bitmaps that represent each character and all the pixels in them, check which pixel is of the original color and replace/adjust it with your desired color.
If the characters aren't that big and you only need two colors (or three if you need a neutral one) you could just have a set of characters of each color and be done with it.
my 2c
If the characters aren't that big and you only need two colors (or three if you need a neutral one) you could just have a set of characters of each color and be done with it.
my 2c
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement