today i play with a tablet input screen.
the best solution is write big letters and after each
letter scroll the input text to the left for new free space.
after input scale the input down.
then the input looks like my signatur
at input i using fast lines and after ready button i paint sprites.
(the missing thing is center all coords.)
rem
rem AGK Application 1.08B8
rem MR
SetDisplayAspect( 4.0/3.0 )
setsyncrate(60,0)
img=loadimage("Dot.png") //32x32 Pixel Circle
sprdot=createsprite(img)
setspritesize(sprdot,0.5,0.5)
setclearcolor(255,255,255)
type TPoint
x as float
y as float
endtype
global PT as TPoint
global P0 as TPoint
global P1 as TPoint
global P2 as TPoint
global P3 as TPoint
dim Grid[5000,32] as TPoint
dim GCount[32] as integer
a=0
down=2
addvirtualbutton(1,70,10,10)
setvirtualbuttontext(1,"CLEAR")
addvirtualbutton(2,80,10,10)
setvirtualbuttontext(2,"READY")
addvirtualbutton(3,90,10,10)
setvirtualbuttontext(3,"EXIT")
xright#=0
do
//print(screenfps())
//print("a "+str(a))
//print("c "+str(GCount[a]))
if getvirtualbuttonpressed(3)=1
exit
endif
if getvirtualbuttonpressed(2)=1
ready=1
endif
if getvirtualbuttonpressed(1)=1
ready=0
xright#=0
for a=1 to 32
GCount[a]=0
next
a=0
endif
t= getpointerstate()
//t = GetRawFirstTouchEvent(1)
x#=getpointerx()
y#=getpointery()
//x# = getrawtouchcurrentx(t)
//y# = getrawtouchcurrenty(t)
if t=0
if down=1
down=2
for ia=1 to a
for i=1 to GCount[ia]
Grid[i,ia].x=Grid[i,ia].x-xright#/2
Grid[i,ia].y=Grid[i,ia].y
next
next
endif
else
if down=2 then a=a+1
down=1
if GCount[a]<5000
GCount[a]=GCount[a]+1
c=GCount[a]
Grid[c,a].x=x#
Grid[c,a].y=y#
if x#>xright# then xright#=x#
endif
endif
if ready=0
for ia=1 to a
for i=1 to GCount[ia]-1 step 1
x1#=Grid[i,ia].x
y1#=Grid[i,ia].y
x2#=Grid[i+1,ia].x
y2#=Grid[i+1,ia].y
drawline(x1#,y1#,x2#,y2#,0,0,0)
next
next
endif
//Paint Dots
if ready=1
setspritecolor(sprdot,64,64,64,128)
for ia=1 to a
for i=1 to GCount[ia]-1 step 1
x1#=Grid[i,ia].x
y1#=Grid[i,ia].y
x2#=Grid[i+1,ia].x
y2#=Grid[i+1,ia].y
for mu#=0.0 to 1.0 step 0.1
x3#=Intp(x1#,x2#,mu#)
y3#=Intp(y1#,y2#,mu#)
x3#=x3#-50.0
y3#=y3#-50.0
x3#=x3#/4.0
y3#=y3#/4.0
x3#=x3#+50.0
y3#=y3#+50.0
setspritepositionbyoffset(sprdot,x3#,y3#)
drawsprite(sprdot)
next
next
next
setspritepositionbyoffset(sprdot,-10,-10)
endif
Sync()
loop
end