sync on
 
input "Enter text: ",text$
 
sleep 500
 
set text font getfont()
 
sleep 500
 
input "Enter text size: ",Tsize
set text size Tsize
 
sleep 500
 
colour=getcolour()
ink colour,0
 
cls
 
text 0,0,text$
 
xsize=text width(text$)
ysize=text height(text$)
 
dim image(xsize,ysize)
 
set text transparent
set text font "system"
set text size 10
 
for x=1 to xsize
	for y=1 to ysize
		image(x,y)=point(x,y)
		count1=count1+1
		ink rgb(0,0,0),0
		box 520,1,639,15
		ink rgb(255,0,0),0
		temp#=count1/(xsize*ysize)
		text 520,0,str$(count1)+"/"+str$(xsize*ysize)+" pixels"
		sync
	next y
next i
 
backdrop on
color backdrop rgb(255-rgbr(colour),255-rgbg(colour),255-rgbb(colour))
 
make object cube 1,0.1
make mesh from object 1,1
 
for x=1 to xsize
	for y=1 to ysize
		if image(x,y)>0
			count=count+1
			add limb 1,count,1
			scale limb 1,count,10000,10000,10000
			offset limb 1,count,((xsize-x)-(xsize/2))*10,((ysize-y)-(ysize/2))*10,0
			color limb 1,count,image(x,y)
		endif
	next y
next x
 
position camera 0,0,0-ysize*50
 
do
	yrotate object 1,wrapvalue(object angle y(1)+1)
	if mouseclick()=1
		move camera 0-mousemovey()
	endif
	sync
loop
 
function getfont()
 
	perform checklist for fonts
 
	font=1
	list=1
	select=1
 
	while returnkey()=0
 
		cls
 
		if upkey()=1 and font>1
			if upK=0
				upK=1
				font=font-1
				if select=1 and list>1 then list=list-1
				if select>1 then select=select-1
				Ucount=40
			endif
			Ucount=Ucount-1
			if Ucount<0
				font=font-1
				if select=1 and list>1 then list=list-1
				if select>1 then select=select-1
				Ucount=2
			endif
		else
			upK=0
		endif
 
		if downkey()=1 and font<checklist quantity()
			if dnK=0
				dnK=1
				font=font+1
				if select=10 and list<checklist quantity() then list=list+1
				if select<10 then select=select+1
				Dcount=40
			endif
			Dcount=Dcount-1
			if Dcount<0
				font=font+1
				if select=10 and list<checklist quantity() then list=list+1
				if select<10 then select=select+1
				Dcount=2
			endif
		else
			dnK=0
		endif
 
		set text font "system"
		for i=1 to 10
			if select=i
				ink rgb(0,0,255),0
				box 10,i*15+20,210,(i+1)*15+20
			endif
			ink rgb(255,255,255),0
			set text font checklist string$(list+i-1)
			text 10,i*15+20,checklist string$(list+i-1)
		next i
 
		ink 0,0
		box 210,35,250,185
 
		ink rgb(255,255,255),0
		linebox(9,34,211,186)
 
		sync
 
	endwhile
 
	cls
 
endfunction checklist string$(font)
 
function getcolour()
 
	while returnkey()=0
 
		cls
 
		for bx=1 to 255 step 4
			for by=1 to 255 step 4
				ink rgb(r,bx,by),0
				dot bx/4+10,by/4+10
			next by
		next bx
		ink rgb(255,255,255),0
		linebox(9,9,74,74)
 
		for i=1 to 255 step 4
			ink rgb(i,0,0),0
			line i/4+10,85,i/4+10,95
		next i
		ink rgb(255,255,255),0
		linebox(9,84,74,96)
 
		ink rgb(155,155,155),0
		linebox(r/4+10-2,83,r/4+10+2,97)
 
		ink rgb(r,g,b),0
		box 10,105,40,125
		ink rgb(255,255,255),0
		linebox(9,104,41,126)
		ink rgb(rpoint,gpoint,bpoint),0
		box 44,105,74,125
		ink rgb(255,255,255),0
		linebox(44,104,75,126)
 
		if mousewithin(10,85,73,95)=1 and mouseclick()=1 then r=(mousex()-10)*4
 
		if mousewithin(10,10,(255/4)+10,(255/4)+10)=1
			if mouseclick()=1
				temp=point(mousex(),mousey())
				g=rgbg(temp)
				b=rgbb(temp)
			endif
			temp=point(mousex(),mousey())
			rpoint=r
			gpoint=rgbg(temp)
			bpoint=rgbb(temp)
		endif
 
		sync
 
	endwhile
 
endfunction rgb(r,g,b)
 
function linebox(x1,y1,x2,y2)
 
	line x1,y1,x1,y2
	line x1,y2,x2,y2
	line x2,y2,x2,y1
	line x2,y1,x1,y1
 
endfunction
 
function mousewithin(x1,y1,x2,y2)
  if mousex()>x1 and mousex()<x2 and mousey()>y1 and mousey()<y2 then exitfunction 1
endfunction 0