Original Post
🔒 Locked
Basic 2D Text
Advertisement
This is what I'm doing to temporarily output some plain text -
(using vb.net but the principle should be the same)
Font variable declaration -
During graphics initialisation -
A subroutine to draw the text -
And then in the OnPaint -
(using vb.net but the principle should be the same)
Font variable declaration -
Private outputFont As Microsoft.DirectX.Direct3D.Font = NothingDuring graphics initialisation -
outputFont = New Microsoft.DirectX.Direct3D.Font(device, New System.Drawing.Font("Arial", 8.0F, Fontstyle.Bold))A subroutine to draw the text -
Private Sub Draw2DText(ByVal strText As String, ByVal x As Integer, ByVal y As Integer, ByVal c As Color) outputFont.DrawText(strText, New Rectangle(x, y, 0, 0), DrawTextFormat.NoClip Or DrawTextFormat.ExpandTabs, c)End Sub 'Draw2DTextAnd then in the OnPaint -
Draw2DText("message 1 : " & message1, 5, 30, Color.Black)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement