I'm not sure what ADV stands for, but here's an ooold example I made like 6 years ago.
Thought I made a more recent text box than this, but guess this'll have to suffice for now. I might write one later.
REM DB-PRO
sync on
thing$ = "Hello, my name is Ozark. We are the elephant people that live in the mountains. If you wish to find the magic key, you must first do something for us. Go to the nearest cave, and there you will find a magical and mystical potatoe head. Bring this back to us and we will tell you where you can find the super duper magic key of Rasberry!"
width = 300
_tele_ = 0
_timeStamp_ = timer()
repeat
cls
if mouseclick() = 1 then inc width
if mouseclick() = 2 then dec width
if width < 80 then width = 80
temp = talkBox(mousex(),mousey(),thing$,width,rgb(200,255,0),rgb(0,0,255), _tele_, _timeStamp_)
if temp <> _tele_
_tele_ = temp
_timeStamp_ = timer()
endif
rem start over and redisplay message
if spacekey()=1
_tele_ = 0
_timeStamp_ = timer()
endif
sync
until returnkey() = 1
`============================================
`Displays a box and text wrapped to the box.
`The height of the box depends on how many
`lines the text is broken down to.
`(X,Y) Top-left corner of box position
`"S" text to display
`"Width" width of the box
`"tColor" is text color
`"bColor" is box color
`============================================
function talkBox(x as integer, y as integer, s as string, width as integer, tColor as dword, bColor as dword, limit as integer, time as integer)
sTemp as string
sTemp = s
lines = 1
while text width(sTemp) > width
length = len(sTemp)
for i = 1 to length
if mid$(sTemp, i) = " "
wIndex = i
endif
if text width(left$(sTemp,i)) > width
inc lines
exit
endif
next i
sTemp = right$(sTemp,length-wIndex)
endwhile
height = text height(s) * lines
ink bColor,0
box x,y,x+width,y+height
ink tColor,0
wrapText(x,y,left$(s,limit),width)
rem delay in milliseconds
delay = 200
if time + delay < timer()
inc limit
if limit > len(s) then limit = len(s)
endif
endfunction limit
`============================================
`Wraps and displays text using the specified
`width as the boundary. Words are not broken
`up when wrapped.
`============================================
function wrapText(x as integer, y as integer, s as string, width as integer)
repeat
length = len(s)
wIndex = 0
for i = 1 to length
if mid$(s,i) = " "
wIndex = i
endif
if text width(left$(s,i)) > width
exit
endif
next i
text x,y,left$(s,wIndex-1)
y = y + text height(s)
s = right$(s,length-wIndex)
until text width(s) < width
text x,y,s
endfunction
