I've used this TextToSprite function for a few things, but I've found if you use more than a couple of sprites on screen things slow down a lot. Anyway, you might find something useful in this.
function TextToSprite(str as string,x as integer,y as integer,color as dword,priority as integer,imgcolkey as dword,centerflag as integer,imgnum as integer,sprnum as integer)
create bitmap 1,200,100
ink color,color
box 0,0,text width(str),text height(str),imgcolkey,imgcolkey,imgcolkey,imgcolkey
text 0,0,str
get image imgnum,0,0,text width(str),text height(str),1
delete bitmap 1
ink rgb(255,255,255), rgb(0,0,0)
sprite sprnum,x,y,imgnum
if centerflag=1 then offset sprite sprnum,sprite width(sprnum)/2,sprite height(sprnum)/2
set sprite priority sprnum,priority
endfunction
Call it with this.
TextToSprite("Show this", mousex(), mousey(), rgb(255,255,255),2,rgb(0,0,0),2,2,2)
I looked around but couldn't find where I got this. Someone else posted it in the forums.