Loading...
Logo
Processing Forum
    Hi,

    I just switched over from PDE to eclipse and I'm already running into my first problem, which is I'm ashamed to say, pretty basic (I guess?). For the life of me I can't seem to get PConstants to work?

    Any of you care to help me out?

    Example:
    1. import processing.core.PApplet;
    2. // No difference if I import processing.core.PConstants;

    3. public class Image {
    4. PApplet parent;
    5. public Image(PApplet parent) {
    6. this.parent = parent;
    7. }

    8. void render() {
    9. parent.beginShape(QUAD_STRIP);      // Does not work.
    10. parent.vertex(100, 100);
    11. parent.vertex(100, 200);
    12. parent.vertex(200, 200);
    13. parent.vertex(200, 100);
    14. parent.endShape(2);                 // Works.
    15. }
    16. }

                          Replies(3)

                          Hi try :
                          Copy code
                          1. public class Image implements PConstants {
                          Have a look at the library basic documentation here
                          Alternatively, you can use parent.beginShape(PConstants.QUAD_STRIP);