SDL highlighting rectangle
Moderator: Coders of Rage
SDL highlighting rectangle
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?
- ibly31
- Chaos Rift Junior
- Posts: 312
- Joined: Thu Feb 19, 2009 8:47 pm
- Current Project: Like... seven different ones
- Favorite Gaming Platforms: Xbox 360, Gamecube
- Programming Language of Choice: C++, ObjC
- Location: New Jersey.
Re: SDL highlighting rectangle
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.
Website/Tumblr
My Projects
The best thing about UDP jokes is that I don’t care if you get them or not.
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: SDL highlighting rectangle
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.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.