|
Post by leon26leon26 on Sept 26, 2016 20:43:09 GMT
A quick&dirty scribble script that utilizes the new multi-touch features. Code: draw.setscreen(2) draw.showtitle(false) xdim,ydim=draw.getport() draw.setlinestyle(6,"round") touches={} function draw.touchbegan(t) for i=1,#t do table.insert(touches,t[i]) end end function draw.touchmoved(t) for i=1,#t do local pos=0 for i2=1,#touches do if touches[i2].id==t[i].id then pos=i2 end end draw.line(touches[pos].x,touches[pos].y,t[i].x,t[i].y,draw.black) touches[pos]=t[i] end end function draw.touchended(t) for i=1,#t do for i2=1,#touches do if touches[i2].id==t[i].id then table.remove(touches,i2) break end end end print(#touches) end while true do draw.beginframe() draw.doevents() draw.endframe() end
|
|