I, I’m trying to create my own library and it’s not so easy.
The small class I create don’t recognize the “color” type even he is in processing.core.
public class Triangle {
color[] colors = new color[3];}
The function sh = createShape();
is not recognize and noStroke(); triangle()
also.
The triangle class begin with package minimap; import processing.core.*;
Here’s an expert in the place ?
1 Like
Function color() exists in Processing’s API:
PApplet
PGraphics
But Processing’s primitive datatype color
is the same as Java’s int
.
2 Likes
I agree, ofCourse. But eclipse bug on these lines. How to access all processing function in my lib ?
Java programming outside the PDE is pretty much like having “.java” file tabs on the PDE:
Countdown.java
/**
* Countdown Class (v1.2.5)
* GoToLoop (2017/Aug/26)
*
* https://Forum.Processing.org/two/discussion/27733/
* countdown-class-library-for-java-js-python
*
* https://Forum.Processing.org/two/discussion/23846/
* time-delay-in-python-mode#Item_11
*
This file has been truncated. show original
CountdownClass.pde
/**
* Countdown Class (v1.2.5)
* GoToLoop (2017/Aug/26)
*
* Forum.Processing.org/two/discussion/27733/
* countdown-class-library-for-java-js-python
*
* Forum.Processing.org/two/discussion/23846/
* time-delay-in-python-mode#Item_11
*
This file has been truncated. show original
Inputs.java
/**
* Keyboard Input Library
* Andrew Errity v0.2 (2015-Oct-01)
* GoToLoop v1.0.4 (2015-Oct-22)
*
* https://Forum.Processing.org/two/discussion/13175/
* do-whille-is-not-working-how-it-suppose-to#Item_12
*
* https://GitHub.com/aerrity/Inputs/blob/master/src/Inputs.java
* https://Gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1
This file has been truncated. show original
Keyboard_Input_Library.pde
/**
* Keyboard Input Library
* Andrew Errity v0.2 (2015-Oct-01)
* GoToLoop v1.0.4 (2015-Oct-22)
*
* https://Forum.Processing.org/two/discussion/13175/
* do-whille-is-not-working-how-it-suppose-to#Item_12
*
* https://GitHub.com/aerrity/Inputs/blob/master/src/Inputs.java
* https://Gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1
This file has been truncated. show original
CanvasResizeWatcher.java
/**
* Canvas Resize Watcher (v1.0)
* GoToLoop (2018/May/04)
* Developed on P3 (v3.3.5)
*
* https://Discourse.Processing.org/t/event-called-when-canvas-is-resized/6643/8
* https://Gist.GitHub.com/GoToLoop/1d1eb18f468a7d5758469707276b6ea1
*/
package gotoloop.listener;
This file has been truncated. show original
Canvas_Resize_Watcher.pde
/**
* Canvas Resize Watcher (v1.0)
* GoToLoop (2018/May/04)
* Developed on P3 (v3.3.5)
*
* https://Discourse.Processing.org/t/event-called-when-canvas-is-resized/6643/8
* https://Gist.GitHub.com/GoToLoop/1d1eb18f468a7d5758469707276b6ea1
*/
import gotoloop.listener.CanvasResizeWatcher;
This file has been truncated. show original
1 Like
Sorry, I don’t understand.
I think it’s an eclipse configuration mistake because I can use PVector but not color and there are both in processing.core.
1 Like
Not in the same way. PVector is defined in Processing’s library API – however color
as a datatype is a keyword handled by the preprocessor that turns pde files into java files before executing them. It does this:
finds the word “color” used as a datatype
replaces it with int
If you are writing java, then you aren’t running your code through the preprocessor. This means:
you have to write “public” or “private” – the preprocessor wont add them for you
you have to use “int” – the preprocessor won’t change color
into int
for you.
et cetera
2 Likes