简体   繁体   中英

paperjs in win8 JAvaSCript-App

i want to use paperjs in a win8 javascript/html app.

but i alreasy have an error when i just start the app and want to create a

Raster("/image/test/mouse.jpg");

the error is:

Exception in Line 5 ...
JavaScript runtime error: 'Raster' undefined

i included the script like this:

<script src="/js/paper-min.js"></script>
<script type="text/paperscript" src="/js/program.js" canvas="canvas-1"></script>

so the Raster is defined in the paper-min.js file and it needs to be used in program.js

the first lines of program.js are

function makeRasterPicture(imgPath) {
    var test;
    var count = 0;
    var test2 = true;
    var raster = new Raster(imgPath);

EDIT:

my script tag:

<script src="/js/paper.js"></script>
<script type="text/paperscript" src="/js/program.js" canvas="canvas-1"></script>

my canvas:

<canvas id="canvas-1"></canvas>

do you have an tip?

The Paperscript documentation suggests that any code using it should mark its <script> tag with type="text/paperscript" .

Edit: and you also may want to specify a canvas on which to operate on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM