- Код: Выделить всё
Function Main_CreateD3DXFont(ByVal fontname As String, Optional size As Currency = 8, Optional bold As Boolean = False, Optional italic As Boolean = False, Optional strikethrough As Boolean = False, Optional underline As Boolean = False) As D3DXFont
Dim fnt As IFont
Set fnt = New StdFont
With fnt
.size = size
.Name = fontname
.bold = bold
.italic = italic
.strikethrough = strikethrough
.underline = underline
Set Main_CreateD3DXFont = d3dx.CreateFont(dev, .hFont)
End With
Set fnt = Nothing
End Function
Sub Render_Text(ByVal font As D3DXFont, ByVal text As String, ByVal x As Single, ByVal y As Single, Optional Color As Long = -1)
Dim RECT As RECT
With RECT
.Left = x
.Top = y
End With
font.DrawTextW text, Len(text), RECT, 0, Color
End Sub