It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, I'm new to lua and all this coding business and starting to learn via Codea.
Just a quick question, I am trying to create a cursor that follows your finger when you touch the screen, and when you remove your finger the cursor disappears.
So far this is my code, it is simple but Im not sure how to get the image to go after the touch ha been removed.
function touch()
if touch.state == ENDED then touching = false
else touching = true
end
end
function setup()
end
function draw()
background(0, 0, 0, 255)
fill(127, 122, 132, 255)
ellipse( CurrentTouch.x, CurrentTouch.y, 15)
if touching == true then draw = ellipse( CurrentTouch.x, CurrentTouch.y, 15)
end
end
Thanks for your help
Comments
how about something like this...
Try that out and see if it works.
But why cant you just use
You could do that too. I just like handling touches in a touch function. Makes it easier to handle as a project gets more complex.
Thanks guys for your help, sorry for a late response.
@skullagepk,
the only problem with yours is that he wants an ellipse, not a sprite.
Also this topic is over a year old...
@skullagepk, Sorry I didn't notice that, and Please don't ad things to ild discussion unless you MUST ask something, and in which case you should PM the person, not bump the thread.
Can I just ask why hasn't this been closed?
@TheRogueBatcher, forum mods don't have time to close every single topic, and it isn't nescessary, please don't bring this topic back up the main page by posting comments like this please