on 03-10-2014 2:39 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.