[SDL] Converting a surface to another color
Jonathan Dearborn
grimfang4 at hotmail.com
Sun Dec 31 19:49:30 PST 2006
If you want a kind of cheezy solution, you can try my code for migrating the color of a surface. It would change the white too, but you could edit the code to prevent that, I guess. It's a strictly pre-rendering function as well (slow). If you want the link, just ask. Otherwise, that alpha mask idea sounds good.
Date: Sun, 31 Dec 2006 16:24:22 -0500From: mrlachatte at gmail.comTo: sdl at libsdl.orgSubject: Re: [SDL] Converting a surface to another colorWhat if you had a gradient function that created rectangles, then used a circular alpha mask?
On 12/31/06, Viktor Dick < dickviktor at gmx.net> wrote:
Hello,I'm trying to write a simple 2D-program with SDL (I do not want to use OpenGL). It is almost ready, but at the moment I paint the marbles of the players withfilledCircleColor. I have painted a circle with gimp with a gradient from red(bottom) to white (top) so it looks better. I can load the image to the program, but I need more colors and I do not want create an extra file for each color. Ineed also blue, green etc. marbles. Does anyone know how to change the color ina loaded surface? In the far future, it should also be possible to let the users switch their colors, so it would not be possible to give a picture of eachpossible color with the package.ThanksViktor_______________________________________________SDL mailing listSDL at libsdl.orghttp://www.libsdl.org/mailman/listinfo/sdl-- Cheers,JoshPGP: http://revvy.box43.net/Josh_Matthews.asc
_________________________________________________________________
Try amazing new 3D maps
http://maps.live.com/?wip=51
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061231/8b387a53/attachment.html
More information about the SDL
mailing list