We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello! I'm new to processing and still not sure how to write a proper object class... What I want to have is a class from which I can create objects with the same size for all of them and a different polygonal shape in it. There shouldn't be (background) color of the object and all the shapes inside should be filled with the same image. If there are more than one shapes the image should cover all of them.. like a mask... And then all of the objects should be put in an array. Something like this:
Sorry, that I can't explain it better... Can someone help me with some tips? Thanks a lot!
Answers
You can create PGraphics with black background and the shape drawn in white and use it to mask the image.
https://processing.org/reference/PGraphics.html
https://processing.org/reference/PImage_mask_.html
You don't really need to create a class to do only this, but if you need one, each object will contain its own PGraphics.
Okay, I try to make this work for me, thank you a lot, Barbara! :)