Self-deleting line
in
Programming Questions
•
8 months ago
Hi Everyone!
I have a little bit of trouble with this bit of code.
It's using the Ketai library for touch support, but the problem is just about basic geometry I fear.
I have a little bit of trouble with this bit of code.
It's using the Ketai library for touch support, but the problem is just about basic geometry I fear.
A line is drawn following the flick of the finger (x,y being the starting position and px, px being the end position) .
What I am trying to achieve is for the line to ''delete itself'' by moving the starting point towards the end point.
What happens though, is that the line is drawn ''backwards''.
What happens though, is that the line is drawn ''backwards''.
Any hint on how to fix this?
- if (timer>1) {
- stroke(0);
- line(px, py, (px-(px-x)/timer), (py-(py-y)/timer) );
- timer--;
- }}
- void canc() {
- o=0;
- timer=20;
- }
1