02-28-2006, 01:49 AM
Code:
Type fb_FontType
w As Integer
h As Integer
Data As uByte Ptr
End Type
Extern fb_FontData Alias "fb_font_8x8" As fb_FontType
'Extern fb_FontData Alias "fb_font_8x16" As fb_FontType
Sub GfxPrint( ByRef text As String, ByVal x As Integer = 0, ByVal y As Integer = 0, ByVal col As Integer = 15, ByVal buffer As Any Ptr = 0 )
'' everyone knows angelo wrote a lot of this :)
'' i try to optimize
Dim row As Integer, i As Integer
Dim bits As uByte Ptr
Dim As Integer h_opt = fb_FontData.h-1, h_opt2
Select Case fb_FontData.h
Case 8
h_opt2 = 3
Case 16
h_opt2 = 4
End Select
For i = 0 To Len(text)-1
bits = fb_FontData.Data + (text[i] Shl h_opt2)
Dim As Integer y_opt = y, x_opt = x + 7
For row = 0 To h_opt
Line (x_opt, y_opt)-(x, y_opt),col,, *bits Shl 8
y_opt += 1
bits += 1
Next row
x += 8
Next i
End Sub
Screen 13
Paint( 0, 0 ), 4
gfxprint "hey hey, no black crap!"
Sleep
for now, this will work for ya. switch which one of those externs is commented to switch between 8x8 and 8x16 text