transparency in SDL
i have a small bitmap image, 29x29, of a circle ball. i want to know how to make the area outside the ball transparent so you cant see it when moving across the differrent colored background.
any help at all is greatly appreciated
Paint the background of the image in a specific color (e.g. magenta) and
should work (0x00ff00ff is the color that will not be drawn).
ball_surface = SDL_LoadBMP("ball.bmp");SDL_SetColorKey( ball_surface, SDL_SRCCOLORKEY, 0x00ff00ff );
should work (0x00ff00ff is the color that will not be drawn).
Or use SDL_image and save your images as png files with alpha channel.
http://www.libsdl.org/projects/SDL_image/
http://www.libsdl.org/projects/SDL_image/
Writing errors since 10/25/2003 2:25:56 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement