IDE for Processing.js
Asked Answered
M

5

9

I'm just getting started with processing.js and neither of the IDEs I use (Aptana, NetBeans) are able to understand the JavaScript syntax processing uses. What is a good editor to use when coding processing.js? At minimum I would like code folding and coloring.

Magdalenamagdalene answered 13/1, 2011 at 8:36 Comment(2)
for which machine do you want the IDE? Windows? linux? Mac?Trevethick
if you js ide then try this: jetbrains.com/idea/features/ajax.htmlTrevethick
A
5

Depends on what you want to do, but did you have a look at the Web IDEs on the processing.js website?

jan.

EDIT: sketch.processing.org is a broken.

Alti answered 24/1, 2011 at 16:24 Comment(0)
M
2

If you plan to use Processing.js with processing's original Java-based syntax then the best IDE is going to be Processing. The 2.0 alpha versions have a JavaScript mode that you can switch into and will make the workflow easier. It will not provide features such as code completion that you are used to with NetBeans etc. There is no IDE that will give you those features with that syntax and writing normal Java will not translate correctly.

Processing.js is really a JavaScript implementation of the Processing API, it just has and additional feature for converting your Processing java-style code into JS. If you write your Processing.js applications directly in JavaScript you will be able to leverage some additional features from IDEs such as Aptana, but of course your code will not compile into a Java Application / Applet. Their JS Quick Start Guide introduces this method.

Magnetochemistry answered 4/6, 2012 at 21:2 Comment(0)
R
0

The next best thing is to use either C++ or Java syntax highlighting. The main determining factors are:

  • Java doesn't allow file-level variables or functions, which are a core part of the PDE definition
  • C++ uses different keywords for importing, inheriting, referencing parent classes and declaring interfaces and this is a pointer dereference (->) rather than a reference (.)

For syntax highlighting both work fine but because of the above issues no matter what you choose, syntax checking cannot be enabled at the same time as syntax highlighting without errors.

Ringster answered 21/8, 2011 at 12:3 Comment(0)
F
0

If you want to code in Processing-Java (versus pure javascript), and also want auto-code completion, I suggest using IntelliJ or Eclipse. Import core.jar from processing into your project to enable auto completion.

Then wrap your code inside of a PApplet subclass:

package pde;
import processing.core.*;
import java.util.ArrayList;

public class MySketch extends PApplet
{
    //your code here
}
Filmer answered 10/1, 2013 at 15:0 Comment(0)
T
0

You could write in on Notepad if you're on Windows. Al you have to do is save it as an HTML document, like the following :

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>
      Your project's title
    </title>
  </head>
  <body>
    <!--The processing.js canvas-->
    <canvas id="mycanvas"></canvas> 
    <!--Imports the processing.js library-->
    <script src="https://cdn.jsdelivr.net/processing.js/1.4.8/processing.min.js">    </script>
    <!--Where you write your code-->
    <script>
    var sketchProc = function(processingInstance) {
      with (processingInstance) {
        //Feel free to change the size
        size(400, 400);
        frameRate(30);
        
        //Write your code here:
        
        
        
        
        
        
      }
    }
    </script>
  </body>
</html>

Hope this helps! :D

Threw answered 10/4, 2020 at 12:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.