f
sprite(CurrentTouch.x,CurrentTouch.y,width,height)
displayMode(FULLSCREEN)
function setup()
end
function draw()
background(40,40,50)
fill(255)
text("Just drag you finger around the screen",WIDTH/2,HEIGHT-50)
sprite("Planet Cute:Character Pink Girl",CurrentTouch.x,CurrentTouch.y)
end
Here’s another version.
displayMode(FULLSCREEN)
function setup()
dx=WIDTH/2 -- middle of screen
dy=HEIGHT/2
end
function draw()
background(40,40,50)
fill(255)
text("Swipe you finger to change positions.",WIDTH/2,HEIGHT-50)
sprite("Planet Cute:Character Pink Girl",dx,dy)
end
function touched(t)
dx=dx+t.deltaX -- change in x position
dy=dy+t.deltaY -- change in y position
end