I'm just learning Processing. My background is in ActionScript. I'm creating a custom class which draws complex objects. As part of this class, I call createShape() a couple of times. Things worked fine until I decided I needed the custom class to extend PShape. Now it will not recognize the createShape() syntax I'm using, and returns an error that says "createShape() expects parameters like: createShape(PApplet, PShape)"
Here's the function, which returns a PShape object. It works fine.
class MyClass
{
...
PShape makeTriangle1( float w, color c )
{
strokeJoin(BEVEL);
PShape t = createShape(TRIANGLE, 0, 0, w, 0, 0, topBar);
t.setFill(c);
return t;
}
}
But when I do this, it returns the error I've quoted above:
class MyClass extends PShape
{
...
PShape makeTriangle1( float w, color c )
{
strokeJoin(BEVEL);
PShape t = createShape(TRIANGLE, 0, 0, w, 0, 0, topBar);
t.setFill(c);
return t;
}
}
Any ideas? Thanks!