Two different ways of doing it: a per-pixel read/write like Matty suggests, OR you can use a seperate sprite for the colored part, and overlay it over the rest of the image -- e.g. have a person, and a seperate (set of) sprite(s) with just the shirt.
If you create the shirt sprite in greyscale (to get light/dark shading), you can draw it in whatever color you want by using setcolor before drawing. If you want two identical characters, one with a red shirt and one with a green shirt:
setcolor 255,255,255
drawimage guy1,100,100
drawimage guy2,400,100
setcolor 255,0,0
drawimage shirt,100,100
setcolor 0,255,0
drawimage shirt,400,100
with setcolor, you can specify whatever hue you want your image to be drawn in -- but you'd have to separate the character from his clothing, otherwise his skin/hair/whatever would also all be drawn in the same shade.
Of course, the catch is that the guy himself and the shirt do need to be aligned to the graphics/animations line up with one another, and are positioned appropriately. Probably the easiest to keep the image dimensions identical, so you can use the same x and y drawing coordinates for both images.
|