We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So I tried creating a LayerSystem class to manage a Layer class that extends PGraphics and would also hold other properties like opacity, visible, etc. The only problem is that PGraphics is different from everything else in Processing in the way that its instances are created through createGraphics().
The reason I want Layer to extend PGraphics is to be able to write stuff like layer.beginDraw() instead of having Layer hold a PGraphics object like layer.pgraphics.beginDraw().
I cant simply create new Layer() because it is createGraphics(int, int) that sets everything up and creating a PGraphics and casting it to Layer doesn't work.