+ 5
Solid Lines (p5)
How can I draw a solid line between my previous mouseClick and the next mouseClick. I have tried using pmouse but it still draws blobs. How can I achieve lines like Emma's Paint Project. https://code.sololearn.com/Wfy2pEgAdY91/?ref=app
13 Answers
+ 11
why do you use mouseDragged and not mousePressed for instance?
+ 13
Perhaps could you add more color and different size of line...
+ 12
ā__JavaScripter__š glad that works. š You can also include a mouseReleased with the same code as the mousePressed. When i draw a line now and try a second line nothing appears on screen. The third line works again etcetera. You can avoid that with an added mouseReleased...
+ 11
ā__JavaScripter__š iām not sure. I have the feeling that painting in the Y direction does not react as well as in the X direction. You can see that best when you draw a horizontal line (perfect) and a vertical line (thereās a delay). No idea why that is, but it could be a nice puzzle to solve... š§
+ 10
ā__JavaScripter__š also, i would put a position:fixed in your CSS for the canvas, so the screen doesnāt move when you drag your finger over the screen š
+ 9
okay, but see what happens if you use mousePressed and mouseReleased instead. Does that give the result you want?
+ 7
ā__JavaScripter__š okay, another ios issue probably š¤£š¤£š¤£š¤£
+ 5
What else could you recommend for this app. I made this bored (again) and I'm wondering how I can improve it.
+ 5
š¤ I don't notice a difference on my end
+ 4
Because I thought mouseDragged drags the mouse across the screen, I thought mousePressed is stationary
+ 4
It works!
+ 4
I'm surprised that's all it took! Thanks!
+ 4
Thank you for the help! I already have the result I want. I thought mousePressed was a stationery event while mouseDragged was not that's why I used it