Mirage Source
Draw text on a decent way - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44)
+------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13)
+------ Thread: Draw text on a decent way (/showthread.php?tid=2329)



Draw text on a decent way - Joost - 01-11-2008

Code:
Public Sub DrawText(ByVal hDC As Long, ByVal X, ByVal y, ByVal Text As String, Color As Long)
    If LenB(Text) > 0 Then
    DD_BackBuffer.SetForeColor 0
    DD_BackBuffer.DrawText X + 2, y + 2, Text, False
    DD_BackBuffer.DrawText X + 1, y + 1, Text, False
    DD_BackBuffer.SetForeColor Color
    DD_BackBuffer.DrawText X, y, Text, False
    End If
End Sub



Re: Draw text on a decent way - timster0 - 15-01-2009

Where would I put this?


Re: Draw text on a decent way - Nean - 16-01-2009

I'm guessing if there is already a drawtext sub, replace it?


Re: Draw text on a decent way - William - 16-01-2009

so this will make the text wider with a shadow?


Re: Draw text on a decent way - timster0 - 16-01-2009

I dunno, it doesn't seem to work with the newer version.


Re: Draw text on a decent way - Jacob - 16-01-2009

You need to set the font object for DX also.
Code:
Public Sub SetFont(ByVal Font As String, ByVal Size As Byte)
Dim FontInfo As New StdFont

    DD_BackBuffer.SetFontTransparency True

    FontInfo.Bold = True
    FontInfo.Size = Size
    FontInfo.Name = Font

    DD_BackBuffer.SetFont FontInfo
    
End Sub