dragonsoli.blogg.se

Processing code mousex
Processing code mousex










processing code mousex

I am currently running into the same issues, so this thread is rather useful. Line(previousXPositions, previousYPositions, previousXPositions, previousYPositions) loop through the trail array and draw a line between all previous trail positions shift previous positions in trail array add latest mouse position to trail array, but first. 'trailLength' stores the number of points that make up the line's "trail" a class to represent a line that follows the mouse

processing code mousex

I'm adding my sketch here: FollowingLine myLine = new FollowingLine() Perhaps I need to investigate mouseDragged() I thought I could drag my finger around the screen and mouseX and mouseY would be constantly updated, but it seems they're only updated when I tap the screen, and dragging my finger around the screen has no impact on mouseX and mouseY. I thought that my sketch wasn't working at all on touch devices, but it seems it's just not working as I expected. I did some searching, but couldn't find exactly the answer to my question. Thanks for your help, and sorry for the "newbie" question. Would it be more straightforward for me to abandon processing.js and just try to get my sketch working online with p5.js instead? Just this morning I discovered the existence of p5.js, and a quick look at the reference there shows that it has Mouse events and Touch events. I'd appreciate if someone could point me in the right direction for a straightforward way to get the location of touch events, in the same way that it is straightforward to get the location of the mouse. I had assumed that mouseX and mouseY would receive the location of touch events on my phone's touchscreen, but then I realised that this might be where my problem is. I did read that processing.js should work with any HTML5-compatible browser. (It's just a simple sketch where a group of lines follows the mouse location.) I have it working fine when viewed on my laptop's browser, but it doesn't work when viewed on my phone.

processing code mousex

I developed a number of Processing sketches many years ago, and just recently decided to embed one of these on my website using processing.js.












Processing code mousex