本文介绍了将处理与网站中的最小库集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我之前曾看到过类似的问题,但似乎总的答案是它无法完成.

I have seen similar questions posted before but seems the general answer is that it cannot be done.

所以,这是我的HTML代码:

So, here is my HTML code :

<head>
  …
  <script type="text/javascript" src="js/processing.js"></script>
  …
</head>

<body>
  …
  <canvas id="my_prog" data-processing-sources="project/my_prog.pde project/my_class.pde"/></canvas>
  …
</body>

在我的草图中,我使用Minim库:

And in my sketch I use Minim libraries :

import ddf.minim.*;import ddf.minim.spi.*;import ddf.minim.ugens.*;

不是在网站上显示我的项目,而是与项目大小成比例的矩形,但是没有图像和声音.

Instead of having my project on my website, there is a rectangular shape proportional to the project size, but without image and sound.

此外,此方法不会"也不行...我不知道该怎么办.

Moreover, this method doesn't work either…I do not know what to do.

有什么建议吗? :)

谢谢

Thib

推荐答案

以这种方式思考:

  • 核心处理"包含您可以在普通的旧版本中使用的所有变量和函数正在处理草图.
  • 您可以将核心处理"部署为Java应用程序.如果这样做,您还可以使用Java库,例如minim.
  • 您还可以使用Processing.js将核心处理"部署为JavaScript.如果这样做,则可以将草图嵌入到网页中,并使用JavaScript语法访问周围网页的html组件.
  • 但是您不能将它们混合使用:您不能在网页中嵌入Java应用程序(小应用程序已死),也不能在JavaScript网页中使用Java库.
  • "Core Processing" contains all of the variables and functions you can use in a plain old Processing sketch.
  • You can deploy "core Processing" as a Java application. If you do so, you can also use Java libraries, like minim.
  • You can also deploy "core Processing" as JavaScript using Processing.js. If you do so, you can embed your sketch into a webpage and use JavaScript syntax to access the html components of that surrounding webpage.
  • But you can't mix them: you can't embed a Java application in a webpage (applets are dead), and you can't use Java libraries in a JavaScript webpage.

Minim是一个Java库,因此您不能在JavaScript应用程序中直接使用它.相反,您必须找到一个执行类似操作的 JavaScript库.您已经发布了一种方法(当您说它不起作用时是什么意思?),但是使用Google搜索"processing.js audio"或"minim javascript"会返回其他方法,包括以下相关问题:

Minim is a Java library, so you can't use it directly in a JavaScript application. Instead, you have to find a JavaScript library that does something similar. You've posted one method (what do you mean when you say it didn't work?), but googling "processing.js audio" or "minim javascript" returns a bunch of others, including this related question:

将带有音频的处理草图导出到JavaScript

此外,您应该熟悉JavaScript控制台.在Web浏览器中,按F12,然后转到控制台"选项卡,然后刷新页面.这将向您显示您遇到的任何错误,这样您将获得比这是一个空白矩形"更多的信息.

Also, you should get acquainted with the JavaScript console. In your web browser, press F12, then go to the console tab, then refresh your page. That will show you any errors you're hitting, that way you have more information than "it's a blank rectangle".

这篇关于将处理与网站中的最小库集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:50