Hi guys,
I am trying to create a kind of terminal display where by my program will type text to the screen with returns
next sentence etc.. but I also want a flashing cursor but the cursor has to be an image 16x17 here is my code
that I have been playing with I almost had it but it's not right any help would be great.
Thanks.
rem
Typing Simulator
First created 13/06/2011
By Pot Noodle
end rem
Const xRes = 800
Const yRes = 600
Graphics xRes, yRes, 32, 60, GRAPHICS_BACKBUFFER
Global txt:String = "BlitzMax Typing Simulator"
Global Cursor:TImage = LoadImage("cur.bmp")' 16x17 blue rectangular cursor
Local fonts:TImageFont = LoadImageFont("petme64.ttf", 16, BOLDFONT)
SetImageFont(fonts)
Local x:Int
Local y:Int
Repeat
Cls
For y = 189 To 200
For x = 80 To 189 Step 16
DrawCursor(x, y)
DrawText(Mid(txt, 1, 1), x, y)
Next
Next
Flip
Until KeyHit(KEY_ESCAPE)
EndGraphics
End
Function DrawCursor(cx:Int, cy:Int)
If MilliSecs() / 500 Mod 2 = 0 Then ' flashing cursor
DrawImage(Cursor, cx, cy, 1)
End If
End Function
[Edit : Code tags added to post - SW]