Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
drawing outlined text
#1
Replace your "Sub DrawText" with this:

Code:
Public Sub DrawText(ByVal hdc As Long, ByVal X, ByVal Y, ByVal Text As String, Color As Long)
    Call SelectObject(hdc, GameFont)
    Call SetBkMode(hdc, vbTransparent)
    Call SetTextColor(hdc, RGB(50, 50, 50))
    Call TextOut(hdc, X - 1, Y - 1, Text, Len(Text))
    Call TextOut(hdc, X + 1, Y - 1, Text, Len(Text))
    Call TextOut(hdc, X - 1, Y + 1, Text, Len(Text))
    Call TextOut(hdc, X + 1, Y + 1, Text, Len(Text))
    Call SetTextColor(hdc, Color)
    Call TextOut(hdc, X, Y, Text, Len(Text))
End Sub
Reply
#2
This was pretty easy to do, took a while for me to find out what did what but then I got a hold of it quickly.

:: Pando
Reply
#3
W/e works.
Reply
#4
one Wrote:jeah, im just not creative enuogh x)

but wouldnt it be better to make it like this?
Code:
Call TextOut(hDC, x - 1, y, Text, Len(Text))
    Call TextOut(hDC, x + 1, y, Text, Len(Text))
    Call TextOut(hDC, x, y - 1, Text, Len(Text))
    Call TextOut(hDC, x, y + 1, Text, Len(Text))
this works better for me Smile
there where some pixels missing with your method, and it looked horrible with some fonts.

Not method T.T
Code:
Call TextOut(HDC, X + 1, Y + 0, Text, Len(Text))
    Call TextOut(HDC, X + 0, Y + 1, Text, Len(Text))
    Call TextOut(HDC, X + 1, Y + 1, Text, Len(Text))
    Call TextOut(HDC, X - 1, Y - 0, Text, Len(Text))
    Call TextOut(HDC, X - 0, Y - 1, Text, Len(Text))
    Call TextOut(HDC, X - 1, Y - 1, Text, Len(Text))

Thats how I do it...

:: Pando
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)