Controlling each finger
Posted: Wed Jun 21, 2017 8:04 pm
This is an example of controlling each finger during multitouch interaction.
This program allows to draw with several fingers simultaneously. Each finger gets its own drawing color.
This program allows to draw with several fingers simultaneously. Each finger gets its own drawing color.
Code: Select all
#.drawsize(20)
>
> i, 1..#.tap()
x,y = #.tap(i,2)
? #.tap(i)
ox = old(oldx,i,x)
oy = old(oldy,i,y)
#.drawcolor(#.hsv2rgb(i*60,1,1):3)
#.drawline(ox,oy,x,y)
.
oldx[i] = x; oldy[i] = y
<
> j, i..10
oldx[j],oldy[j] = -1
<
<
old(array,i,v)=
x = array[i]
? x<0
<= v
.
<= x
.