We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, guys.
I'm working on the examples of the book: MAKE: Getting Started with p5.js .
I've come across with a few questions regarding the book, and Examples 5-20, 5-21 Touch functions in the book;
Q1. First of all, is there anywhere to post, discussions going on, issues addressed about the book other than the forum here?
Q2. Found out function 'touchIsDown' ('touchIsStarted' in code examples https://github.com/lmccart/gswp5.js-code)is no longer available, but updated to 'touchStarted' according to the Reference. Is it right?
Q3. No particular instructions how to try these touch function examples given in the book. Can anyone suggest how or where to look at?
Here are the codes of Example 5-20 and 5-21;
:::5-20:::
function setup() {
createCanvas(240, 120);
}
function draw() {
background(204);
line(20, 20, 220, 100);
if (touchIsDown) {
line(220, 20, 20, 100);
}
}
:::5-21:::
function setup() {
createCanvas(480, 120);
fill(0, 102);
smooth();
noStroke();
}
function draw() {
ellipse(touchX, touchY, 15, 15);
}
thx!
Comments
@tkwanjp --
A1. I'm not sure about MAKE book feedback. Given that the subject is p5.js and the authors are Processing founders I would guess here, although in addition you could also use the Amazon page, contact the press, or contact the authors directly depending on your issue. https://www.amazon.com/Getting-Started-p5-js-Interactive-JavaScript/dp/1457186772
A2. The Reference section on Events: Touch is correct: https://p5js.org/reference/#group-Events Note that the reference entries come with example code and that you can also search this forum for examples using those function keywords.
A3. When you ask "how to try" what do you mean specifically? A p5.js sketch is a web page -- post it to any public web host and then load the page from a mobile browser in order to test mobile interaction.
@jeremydouglass
Thanks for the advices!
I've decided to shift from learning on the book toward corresponding online video lectures; https://www.kadenze.com/courses/introduction-to-programming-for-the-visual-arts-with-p5-js/info
I'll keep looking up on the refs through the way!
"A3. post it to any public web host"
That was my concern. I will look up more for how exactly I can do that. It may sound super simple stuff as you do google search for some people. For me, it doesn't. Can it be as simple as just pasting index.html url on the browser to make a sketch work?
@tkwanjp -- re: "how exactly I can do that" (post p5.js sketches to any public web host)
If you don't have a website then see the many free options discussed here: