cancel
Showing results for 
Search instead for 
Did you mean: 

HTML Island: Using processing.js or paper.js

Former Member
0 Kudos

Does any of you tried to use either processing.js or paper.js inside of an HTML Island? I made a lot of tries, but without any success. To me
the main problem seems to connect the JavaScript File while loading and executing with an existing canvas object. The HTML code I want to include in the HTML Island is as follows:


<html>

<head>

     <script type="text/javascipt" src="paper.js"></script>

</head>

<body>

     <script type="text/paperscript" canvas="myCanvas" src="myScript.js"></script>

     <canvas id="myCanvas"></canvas>

</body>

</html>

The files paper.js and myScript.js (which includes some basic paper.js commands) are MIME Objects of the HTML Island. paper.js is also included as an HTMLSCRIPT to the HTML Island. Now I have no idea how to execute myScript.js correctly. The main point is, that I have to include the type and canvas properties to the call. Both are not supported when using the interface IF_WD_HTML_SCRIPT_CALL. Any other ideas?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If someone is interested in the solution: You have to reproduce the global scope of the library in the JavaScript code by yourself, which is implicitly done in the example above by using the type "text/paperscript" tag. How to do this for paper.js this is described in details here:

http://paperjs.org/tutorials/getting-started/using-javascript-directly/

Everything else is than straightforward html island integration.

Thomas

Answers (0)