问题描述
对于那些不知道的人来说,处理是一个主要用于显示数据的语言/ Java库。
For those that don't know, processing is a language/ Java library primarily used for displaying data nice and pretty.
Processing.js是它的javascript端口作者:John Resiq。那个家伙所做的一切都是财富。
Processing.js is its javascript port made by John Resiq. Everything that guy makes is a treasure.
根据上一个问题,我了解到Processing的许多库在Processing.js中不起作用。为什么是这样? Processing提供了一个临时编译器,可以将处理代码转换为等效的javascript。
As per a previous question I learned that Processing's many libraries would not work in processing.js. Why is this? Processing provides a makeshift compiler that turns the processing code into its javascript equivalent.
对于这个问题的背景,我正在为最后一年的项目构建一个游戏,我正在研究使用processing.js作为基础。什么让web.js成为网络上更大的力量的原因是缺少图书馆(值得一提的是box2d.js)。
For context to this question, I'm building a game for a final year project and am looking into using processing.js as the base. Whats holding the processing.js back from being an even bigger force in the web is the lack of libraries (honorable mention to box2d.js).
处理的2个问题.js是pde到js的编译器不处理任何其他processing.js库。只有核心处理对象和函数。
The 2 problems with processing.js is that the compiler for pde to js doesn't handle any other processing.js libraries. Only the core processing objects and functions.
另一个是完全缺乏处理库来处理Processing.js
The other is the sheer lack of Processing libraries ported to work with processing.js
所以问题总结如下:
什么是使用库保存处理和处理.js已经买了吗?
What is it that holds processing and processing.js back from using the libraries already buit?
我是否值得花时间关注John resiq的步骤并将一些处理库移植到Javascript?记住,他花了7个月。
Is it worth my time following John resiq's steps and porting some of the processing libraries to Javascript? bare in mind, it took him 7 months.
是否值得建立在他的编译器之上,并试图让它有点动态来确定外部库的位置叫做。
IS it worth while building on top of his compiler and trying to make it somewhat dynamic in figuring out where external libraries have been called.
推荐答案
Processing.js和Processing看起来很相似,但显然存在差异。
Processing.js and Processing may look similar, but obviously there are differences.
AFAIK Processing是为了让设计师/艺术家的生活更加容易通过编程扩展他们的工具集。
最初它是作为Java库和最小的IDE(PDE)构建的。
Processing.js是javascript中该库的端口。
AFAIK Processing was made to make the life of designers/artists wanting to extend they're toolset via programming easier.Originally it was built as a Java library and a minimal IDE (the PDE).Processing.js is a port of that library in javascript.
这意味着对用户来说,处理和处理。 js可能看起来一样,在幕后实现是非常不同的。与Java实际上不同的是Javascript:)
This means that while to the user, Processing and Processing.js may look the same, behind the scenes the implementation is very different. As different as Java is to Javascript actually :)
要理解处理库在Processing.js中不起作用的原因是要理解Java和Javascript之间的差异。例如,javascript是浏览器的解释脚本语言,而java代码将编译转换为字节码,然后由虚拟机(Java虚拟机(JVM)执行) )。
To understand why Processing libraries won't work in Processing.js is to understand the differences between Java and Javascript. For example, javascript is a scripting language interpreted by the browser, while java code get's compiled into bytecode that is then executed by a virtual machine (the Java Virtual Machine (JVM)).
总之,您不能将Processing库(它是一个Java库)与Processing.js一起使用,但是如果你可以将Processing库从Java移植到Javascript中想要。
就是很好的例子。
In conclusion, you can not use a Processing library (which is a Java library) with Processing.js, but you can port a Processing library from Java to Javascript if you want to.Toxiclibs.js is great example of that.
这篇关于是什么阻止了处理库被用于处理.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!