简体   繁体   中英

Play framework + Processing js

Has someone by any chance tried to mix Processing, the programming language, and Play framework? I spend a few days trying to do this, to have one of my Processing js sketches appear in a Java play app with no luck at all...

I haven't used the Play framework, but I've been using Ruby on Rails with Processing. The processing.js is running in the front end. Make sure to provide the processing.js library and the .pde with your sketch in the folder where you keep your resources. Reference both the library and your sketch from a page using these HTML elements:

<script src="processing-1.0.0.min.js"></script>
<canvas data-processing-sources="hello-web.pde"></canvas>

It could be you need to change scr attribute in the script tag, and the data-processing-soruces attribute in your canvas tag to correspond with the tag from where they are accessible through the application.

As a pointer to where to store resources in Play framework, here is a stack overflow case about this: playframework custom resouces.

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