简体   繁体   English

播放框架+处理js

[英]Play framework + Processing js

Has someone by any chance tried to mix Processing, the programming language, and Play framework? 是否有人偶然将Processing,编程语言和Play框架混合在一起? 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... 我花了几天时间尝试做到这一点,让我的Processing js草图之一出现在Java Play应用中,一点也不走运...

I haven't used the Play framework, but I've been using Ruby on Rails with Processing. 我没有使用Play框架,但是我一直在使用Ruby on Rails和Processing。 The processing.js is running in the front end. processing.js在前端运行。 Make sure to provide the processing.js library and the .pde with your sketch in the folder where you keep your resources. 确保在您保留资源的文件夹中提供processing.js库和.pde及其草图。 Reference both the library and your sketch from a page using these HTML elements: 使用以下HTML元素从页面引用库和您的草图:

<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. 可能是您需要更改script标记中的scr属性,而canvas标记中的data-processing-soruces属性与通过应用程序可访问它们的标记相对应。

As a pointer to where to store resources in Play framework, here is a stack overflow case about this: playframework custom resouces. 作为指向在Play框架中存储资源的位置的指针,这是关于此的堆栈溢出情况: playframework自定义资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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