Take a look at this Text to Sprite example I created for
soyuz in the
DarkBASIC Pro Discussion :: Creating text as a sprite on the fly thread.
WORKBMP=1
MESSAGE$="Press Esc key to finish!"
TW=Text Width(MESSAGE$)
TH=Text HEIGHT(MESSAGE$)
Create Bitmap WORKBMP,TW+2,TH+2
Rem This will create a border around your text to give a nice outline effect to your messages
Ink RGB(31,0,0),RGB(0,0,0)
For Y=0 to 2
For X=0 to 2
Set Cursor X,Y : Print MESSAGE$
Next X
Next Y
Ink RGB(255,255,255),RGB(0,0,0)
Set Cursor 1,1 : Print MESSAGE$
Get Image 1,0,0,Text Width(MESSAGE$),Text Height(MESSAGE$)+2,1
Delete Bitmap 1
Print "I've just created a SPRITE from MESSAGE$ in the background."
Print "That way, it doesn't interfere with this display."
Print
Print "Press a key to see the message..."
Wait Key
CLS RGB(240,63,63)
Print "Can you see this text when Set Sprite 1,1,1 is remmed out below"
Set Sprite 1,1,1
Repeat
Sprite 1,Rnd(Screen Width()-Text Width(MESSAGE$)),Rnd(Screen Height()-Text Height(MESSAGE$)),1
Wait Key
Until Scancode()=1
End
Load it up and run it once.
Then Rem out line 36 where it says "Set Sprite 1,1,1"
Run it again to see the difference:
You should investigate some of the other Sprite and Object commands available to you, (noteably
Set Sprite,
Set Object and
Backdrop Off commands) to help with your program, as it seems you may need to make the sprites/objects backgrounds transparent in order to see text on the screen properly.
Good Luck!