+ 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 Antworten
+ 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