mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 13:21:07 +01: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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user