Valhalla Legends Forums Archive | Adron's forum | Adron - Alpha of objects drawn in Starcraft?

AuthorMessageTime
PermaphrostDoesn't look like there has been much activity in this particular forum for a while, but since you're the only other person I'm aware of who has worked extensively with drawing text or objects in Starcraft, I was wondering something. A while ago I created a plugin for Starcraft that allowed cross-realm messaging and a bunch of other things. I drew a user interface using some native Starcraft functions. It looked like this.



However, I got a lot of complaints that it was difficult to see what was going on when the message log was brought up, despite the fact that it could be turned off. So I decided to make it transparent. But, despite a lot of searching, I didn't find a function that allowed me to adjust the alpha of anything drawn to the screen. So instead, I created a function to draw an array of lines spaced one pixel apart to simulate transparency. I have the source available here. Below is what it looks like.



My question is whether or not you stumbled across a way to adjust the alpha on drawn objects such as solid boxes or text. Surely one must exist, as Starcraft's menus are transparent. Just wondering if you had ever found such a function.
May 24, 2007, 10:27 PM
AdronI'm not sure. Starcraft runs in a graphics mode that uses a palette, unless I remember things wrong. This makes it hard to make things transparent. What there might be is some generic way to draw a transparent "window background" over an area on the screen, something that just makes everything in the area darker. I doubt that actual text or buttons or highlights are transparent? But I haven't searched for or stumbled on the function to do it.June 02, 2007, 08:30 AM
AndyFor a better effect, if you don't get a way to do transparency, do an alternating style, like a chessboard, instead of lines. It usually looks much smoother.June 02, 2007, 12:10 PM
Permaphrost
I'm not sure. Starcraft runs in a graphics mode that uses a palette, unless I remember things wrong. This makes it hard to make things transparent. What there might be is some generic way to draw a transparent "window background" over an area on the screen, something that just makes everything in the area darker. I doubt that actual text or buttons or highlights are transparent? But I haven't searched for or stumbled on the function to do it.

Yeah, you're right. Apart from a generic colored background there is nothing in the game that seems to have an adjusted transparency, so that is probably what the function would be. Even that would be useful, though. Thanks for your input.

Quote from: RealityRipple
For a better effect, if you don't get a way to do transparency, do an alternating style, like a chessboard, instead of lines. It usually looks much smoother.

I tried that, but I suppose I got the mathematical part of it wrong, because it just filled the box solid. I'll probably go back to it at some point, though, this is just a project I whipped up for some fun.
June 04, 2007, 12:46 AM