MAKE: Getting Started with p5.js book - Example 5-20 Touch the Screen

edited March 2017 in p5.js

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

Sign In or Register to comment.