-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proof of concept now working. Touch events passing through socket fro…
…m iPhone to slide deck
- Loading branch information
1 parent
ae68655
commit 3e8e7e5
Showing
7 changed files
with
134 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
function gameMessageHandler(msg) { | ||
console.log("message received: " + msg); | ||
whiteBackground = !whiteBackground; | ||
} | ||
|
||
var touchX = 0, touchY = 0, lastTouchX = 0, lastTouchY = 0; | ||
|
||
function touchMove(x, y) { | ||
touchX = x * windowWidth; | ||
touchY = y * windowHeight; | ||
} | ||
|
||
|
||
function setup() { | ||
var canv = createCanvas(windowWidth, windowHeight); | ||
canv.parent("bgCanvas"); | ||
background(0,0,0); | ||
} | ||
|
||
var currentColor = 0; | ||
|
||
function draw() { | ||
colorMode(RGB, 255); | ||
fill(0,0,0,10.0); | ||
rect(0, 0, windowWidth, windowHeight); | ||
colorMode(HSB, 255); | ||
stroke(currentColor, 255, 255); | ||
strokeWeight(10.0); | ||
currentColor = (currentColor + 1) % 255; | ||
line(lastTouchX, lastTouchY, touchX, touchY); | ||
lastTouchX = touchX; | ||
lastTouchY = touchY; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters