Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bolding
#1
How do I make the text blt in bold? And how do i make the texts in text boxes bold?
Reply
#2
well for a text box i believe you just put
Code:
txtBox.FontBold = True

but if your planning on using it for a chat system i would suggest switching it to a richtext box instead, that allows for colors and such.

as for blt i have no clue
Reply
#3
ok just took a look at the AddText sub. that would be very easy to put in. all you have to do is add this
Code:
frmMirage.txtChat.SelBold = True

but other wise idk.
Reply
#4
Bolding is easy.

Code:
Public Sub DrawText(ByVal hdc As Long, _
                    ByVal X, _
                    ByVal Y, _
                    ByVal Text As String, _
                    Color As Long, _
                    Optional ByVal Bold As Boolean = False)

    SelectObject hdc, GameFont
    SetBkMode hdc, vbTransparent

    SetTextColor hdc, Color

    If Bold Then
        TextOut hdc, X - 1, Y, Text, Len(Text)
        TextOut hdc, X + 1, Y, Text, Len(Text)
        TextOut hdc, X, Y - 1, Text, Len(Text)
        TextOut hdc, X, Y + 1, Text, Len(Text)
    End If

    TextOut hdc, X, Y, Text, Len(Text)

End Sub

You can still keep the normal DrawText around, but if you want to do something bold then just do DrawText(blahblah, True).

Not sure how it would look...probably really hard to read (depending on font).
Reply
#5
Is that the only way to do it? I looks really crappy when I do it.

Thanks Pbcrazy, that did the trick.
Reply
#6
Wouldn't.. it be easier to just CreateFont with a bold setting?

o.O
Reply
#7
Lmao GIAKEN, that's some stroke effect code.

For the font, go to the top of GameLoop, where it should show the font name in quotations.

Still within the quotations afters the font name, simply add 'Bold'.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
It works Confusedhock: thx
Reply
#9
Ramsey Wrote:Is that the only way to do it? I looks really crappy when I do it.

Thanks Pbcrazy, that did the trick.

np glad i could help.
Reply
#10
Well I don't do what I posted, because I don't use Bold...but I just put that together because I read that the default font MS uses doesn't support bold...
Reply
#11
You can stil lset it to bold, I think bold is like.. 700, and Italic is 400.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)