Files
processing4/javascript/examples/Environment/Input/lockedIn/promt.js
2011-06-18 19:37:00 +00:00

20 lines
429 B
JavaScript

// wait for document to load
window.onload = function () {
tryFindSketch();
}
// find sketch instance
function tryFindSketch () {
var sketch = Processing.instances[0];
if ( sketch == undefined )
setTimeout( tryFindSketch, 200 ); // try again in 0.2 secs
else
sketch.setJS( this );
}
// called from inside the sketch
function promtForInput ( msg, def ) {
return window.prompt( msg, def );
}