mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Updated JS mode examples, changed convenience function to have same camel case as Processing.getInstanceById()
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
// Get the instance. We just use the first one. Another way would be to use
|
||||
// the automaticaly generated ID "colorFinder", see <canvas> in index.html
|
||||
var mySketchInstance = Processing.getInstanceById( getProcessingSketchID() );
|
||||
var mySketchInstance = Processing.getInstanceById( getProcessingSketchId() );
|
||||
|
||||
if ( mySketchInstance == undefined ) { // means it has not started
|
||||
setTimeout( makeTheLink, 200 ); // try again later
|
||||
|
||||
@@ -5,7 +5,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById( getProcessingSketchID() );
|
||||
var sketch = Processing.getInstanceById( getProcessingSketchId() );
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryFindSketch, 200); // retry after 0.2 secs
|
||||
else
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ window.onload = function () {
|
||||
|
||||
// this is called (repeatedly) to find the sketch
|
||||
function getSketchInstance() {
|
||||
var s = Processing.getInstanceById(getProcessingSketchID());
|
||||
var s = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( s == undefined ) {
|
||||
setTimeout(getSketchInstance, 200); // try again a bit later
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch() {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); // retry soon
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
|
||||
// find sketch instance
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
setTimeout( tryFindSketch, 200 ); // try again in 0.2 secs
|
||||
else
|
||||
|
||||
@@ -4,7 +4,7 @@ window.onload = function () {
|
||||
var audioNode = document.getElementsByTagName("audio")[0];
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryFindSketch,200); // retry
|
||||
else
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
|
||||
// try and find the sketch
|
||||
function tryLinkSketch() {
|
||||
var sketch = Processing.getInstanceById( getProcessingSketchID() );
|
||||
var sketch = Processing.getInstanceById( getProcessingSketchId() );
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryLinkSketch, 200); /*try again later*/
|
||||
else {
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); // try again ..
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ window.onload = function () {
|
||||
}
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined ) return setTimeout(tryFindSketch, 200);
|
||||
|
||||
var controller = new Controller(sketch,"form-form");
|
||||
|
||||
@@ -3,7 +3,7 @@ window.onload = function () {
|
||||
video['loop'] = true;
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); // retry in 0.2 secs
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ window.onload = function () {
|
||||
|
||||
// try to find the Processing sketch instance, or retry
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
setTimeout(tryFindSketch, 200); // retry in 0.2 secs
|
||||
else
|
||||
|
||||
@@ -11,7 +11,7 @@ window.onload = function () {
|
||||
|
||||
// try to get the sketch instance from Processing.js
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout( tryFindSketch, 200 ); // retry
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ window.onload = function () {
|
||||
var sendImage = null;
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); //retry later
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ window.onload = function () {
|
||||
var sendTweet = null;
|
||||
|
||||
function tryFindSketch () {
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchID());
|
||||
var sketch = Processing.getInstanceById(getProcessingSketchId());
|
||||
if ( sketch == undefined )
|
||||
return setTimeout(tryFindSketch, 200); //retry later
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ LibraryManager, updating, ..
|
||||
Update reference / wiki to mirror changes.
|
||||
Make tutorial / template for Library authors.
|
||||
|
||||
Check "Duplicate import!" message
|
||||
|
||||
Sketch > Import Library > ...
|
||||
Does not work, complains about libs not supported
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Reference
|
||||
|
||||
Reference in New Issue
Block a user