Skip to content
Advertisement

p5.js: Drawing tool doesn’t work well on mobile devices

For a project, I would like to work with this code:

JavaScript
JavaScript

I realized that it doesn’t work well on mobile devices. Sometimes nothing draws, sometimes I get some colored dots. It should possible to draw “normally” with the finger.

Is there a way to fix that? Would be very thankful for help! <3

Advertisement

Answer

This won’t work as a runnable snippet on StackOverflow because they don’t show up on mobile devices, but here you go (runnable version on OpenProcessing):

JavaScript

For more info see the Events – Touch section fo the p5.js reference.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement