My RTPrint command works just like the TEXT command in DB
only it can print in many styles and colors in the same command! by embedding byte script commands into the text
to print! see example below. Put it in DB and give it a run
I made it easier to embed by providing three functions to encode your strings: Style$() Color$() and Size$() functions.
+ Code Snippetdim A$(10)
A$(0)=Size$(20)+Color$(0,0,255)+"Russel "
A$(0)=A$(0)+Color$(255,0,0)+Style$(2)+Chr$(34)+"IronHoof"+Chr$(34)+" "+Style$(0)
A$(0)=A$(0)+Color$(0,0,255)+"Hamrick "+Color$(0,255,0)+Style$(2)+"2002"
A$(1)=Size$(10)+Color$(255,0,150)+Style$(2)+"This is a small example of a byte script"
A$(1)=A$(1)+" imprinted rich text."
A$(2)=Style$(0)+Color$(255,255,255)+"It "+Color$(255,255,0)+Size$(40)+Style$(2)+"CAN "
A$(2)=A$(2)+Size$(10)+Color$(255,255,255)+Style$(0)+"print many styles all in one string."
a$(3)=Color$(150,0,150)+"In all "+Color$(150,0,0)+"C"+Color$(255,0,0)+"O"+Color$(0,150,0)
a$(3)=a$(3)+"L"+Color$(0,255,0)+"O"+Color$(0,0,150)+"R"+Color$(0,0,255)+"S"
a$(4)=Color$(184,64,106)+"This example is over "+Style$(2)+Size$(60)+"GOODBYE!"
for i=0 to 10
RTPrint(10,10+(I*40),A$(i))
next i
end
function RTPrint(X,Y,TEXT$)
L=1
GONEX:
C$=MID$(TEXT$,L):TMP$=""
if c$=chr$(24) then set text to italic:inc l,1
if C$=chr$(26) then set text to bold:inc l,1
if c$=CHR$(27) then set text to normal:inc l,1
if C$=chr$(25)
R$=MID$(TEXT$,L+1):G$=MID$(TEXT$,L+2):B$=MID$(TEXT$,L+3):inc L,4
R=ASC(R$):G=ASC(G$):B=ASC(B$):ink rgb(R,G,B),0
endif
if C$=chr$(23)
S$=MID$(TEXT$,L+1):set text size asc(S$):inc L,2
endif
junction:
C$=MID$(TEXT$,L):IS=0
if asc(C$)>31 and asc(C$)255 then size=255
TMP$=CHR$(23)+CHR$(size)
endfunction TMP$