

![]() |
![]() |
|
|||||||
![]() |
![]() |
| Code Snippets and Tutorials The place for open source releases, great information, and tutorials written by other members. |
![]() |
|
|
LinkBack | Thread Tools |
![]() |
![]() |
|
|
#1 (permalink) |
|
rol 3905h, 8
Senior Member
Administrator ![]() ![]() Saint Join Date: Jul 2004
Location: Canada
Posts: 5,414
![]() |
Here are a few functions I wrote up for drawing transparent window panes in Starcraft. The first function is used to draw a box based on the parameters you pass to it. The box is quite solid, like the original Starspeak interface.
Drawing Solid Boxes Code:
.data
BWFXN_DrawBox dd 004E18E0h
.code
DrawBox proc x:DWORD,y:DWORD,w:DWORD,h:DWORD,clr:BYTE
mov cl,clr
mov byte ptr ds:[006CF494h], cl
push h
push w
push y
push x
call dword ptr [BWFXN_DrawBox]
ret
DrawBox endp
Code:
invoke DrawBox, xcoordinate, ycoordinate, width, height, color In addition to drawing lines spaced one pixel apart, the function also draws a border around the object. You can adjust the inner and border colors to your liking. Drawing a Transparent Box Code:
DrawTransparentBox proc x:DWORD,y:DWORD,w:DWORD,h:DWORD,clr:BYTE,midclr:BYTE
pushad
mov edx, y
mov eax, h
add eax, edx
mov ebx, eax
.while edx < ebx
pushad
invoke DrawBox, x, edx, w, 1, midclr
popad
add edx, 02h
.endw
invoke DrawBox, x, y, w, 2, clr
invoke DrawBox, x, ebx, w, 2, clr
invoke DrawBox, x, y, 1, h, clr
mov eax, x
mov ebx, w
add ebx, eax
invoke DrawBox, ebx, y, 1, h, clr
popad
ret
DrawTransparentBox endp
Code:
invoke DrawTransparentBox, xcoordinate, ycoordinate, width, height, bordercolor, innercolor Last edited by Perma : 05-20-2008 at 01:44 AM. |
|
|
|
![]() |
![]() |
|
Advertisement
|
|
![]() |
![]() |
|
|
#2 (permalink) |
![]() ![]() ![]() Advocate Join Date: Jul 2006
Location: Cream
Posts: 304
![]() |
OOOO this will be very useful, thx a lot!
Any chance on telling me how you got the address used to draw the box? I doubt I would figure it out and I like to convert the hacks I code just in case of a new patch ![]() |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#3 (permalink) |
|
rol 3905h, 8
Senior Member
Administrator ![]() ![]() Saint Join Date: Jul 2004
Location: Canada
Posts: 5,414
![]() |
Actually I think it was Kc who originally found that function a few patches ago. If you're simply converting it, there's no need to reinvent the wheel. You can just create a disassembly of both versions and cross reference them.
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#5 (permalink) |
![]() ![]() ![]() ![]() ![]() Crusader Join Date: Feb 2005
Location: Tucson, AZ
Posts: 3,327
![]() ![]() ![]() ![]() ![]() ![]() |
To the best of my ability to find it, SC lacks a native ability to adjust alpha levels on anything drawn in game. Sprites are given a visible and not-visible flags though, that dictate if they appear or not to whomever.
__________________
![]() Burn, baby, burn. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#8 (permalink) |
|
=)
Senior Member
Retired Staff Member ![]() ![]() ![]() ![]() Messiah |
How did I find the DrawBox fxn? When starcraft is drawing the minimap and it is drawing the tiny little blocks to represent units it calls that drawbox fxn, and when I was working on my maphack I stumbled on it and bam, there it is.
__________________
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#10 (permalink) |
|
Gold Member
![]() ![]() Deviant Join Date: May 2007
Location: Behind You!
Posts: 138
![]() |
I fail to understand where you got this from:
BWFXN_DrawBox dd 004E18C0h What function does this address need to be and how would you go about finding it? Besides that I pretty much understand all of the concept of this, so go me. ![]() |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#12 (permalink) | |
|
Administrator
![]() Inquisitor Join Date: Jul 2004
Location: Germany
Posts: 4,545
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
That's when I found the drawing functions. 08-23-2004. |
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#13 (permalink) | |
|
rol 3905h, 8
Senior Member
Administrator ![]() ![]() Saint Join Date: Jul 2004
Location: Canada
Posts: 5,414
![]() |
Quote:
![]() |
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#14 (permalink) | ||
|
C2 100E
Senior Member
Retired Staff Member ![]() ![]() High Priest |
Quote:
__________________
![]() I get laid. Quote:
|
||
|
|
|
![]() |
![]() |