This is a scrolling example:
;-----------------------------------------------------------------------------------------------------
; types
;-----------------------------------------------------------------------------------------------------
Type TLine
Field s$
End Type
;-----------------------------------------------------------------------------------------------------
; build stuff
;-----------------------------------------------------------------------------------------------------
;setup graphics
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()
;create a few lines
For i = 0 To 20
CreateLine( "Line no." + i )
Next
;init
TFirst.TLine = First TLine
TLast.TLine = Last TLine
sel = 1
;-----------------------------------------------------------------------------------------------------
; main loop
;-----------------------------------------------------------------------------------------------------
Repeat
;check range
test1 = (TFirst <> First TLine) And (sel = 1)
test2 = (TLast <> After After After After First TLine) And (sel = 5)
;cursor up
If KeyHit(200) Then
If test1 Then
Insert Last TLine Before First TLine
Else
If sel > 1 Then sel = sel - 1
End If
End If
;cursor down
If KeyHit(208) Then
If test2 Then
Insert First TLine After Last TLine
Else
If sel < 5 Then sel = sel + 1
End If
End If
;draw graphics
Cls
l.TLine = First TLine
Color 0, 255, 0
;take 5 lines
For c = 1 To 5
;line "sel" is green
If c = sel Then Color 0, 255, 0 Else Color 255, 255, 255
If l <> Null Then
;draw text to screen
Text 400, 200 + c * 20, l\s$, 1, 1
;jump to next line
l = After l
End If
Next
;show graphics
Flip
;esc = exit
Until KeyHit(1)
End
;-----------------------------------------------------------------------------------------------------
; CreateLine()
;-----------------------------------------------------------------------------------------------------
;create a line
Function CreateLine.TLine(s$)
l.TLine = New TLine
l\s$ = s$
Return l
End Function
For wordwrapping, look at gosse's wrapping functions. They are very nice:
http://www.devcrunch.com/forum/viewtopic.php?t=19