Page 1 of 1
SDL highlighting rectangle
Posted: Thu Apr 29, 2010 5:56 pm
by pythip
I was wondering if there was a way to make SDL_FillRect() semitransparent so that I can highlight the image behind it, anyone know of a way?
Re: SDL highlighting rectangle
Posted: Thu Apr 29, 2010 6:14 pm
by ibly31
You need to blit an image that is transparent to do that. SDL_FillRect has no built in funcitonality to do transparency. If its a set size that you want to highlight, you can just make an image that size and blit it over the object to highlight it. If its not a set size, there are other ways. Just ask if thats the case.
Re: SDL highlighting rectangle
Posted: Thu Apr 29, 2010 8:00 pm
by Ginto8
well, you could do SDL_FillRect for a slightly larger size BEFORE blitting the image. This would have the same effect as a separate surface with a large colorkeyed section, and may have better performance.