We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi Everyone!! I have one problem on processing. I created two layers. But I would like to cut the second layer (the visible one) with the mouse. In this way the first layer would be visible through the cut. It should be something in the Lucio Fontana style.
Can anyone help me?
Thank you very much! Giu
Answers
Maybe. What code do you have so far? How are you drawing he layers?
In computer graphics that transparency is called an alpha channel. Processing colors have a fourth alpha value (e.g. RGBA).
https://processing.org/reference/alpha_.html
The sketch background cannot have alpha, but layers (PGraphics) can. So, if you want to draw onto that surface in a way that makes pixels see-through, set your drawing color alpha to 0.
Alternately, you could use masking.
https://processing.org/reference/PImage_mask_.html
hey! thank you for your reply.
I found this sketch on the Internet that it is very close to what I need to do. a part for the fact that the layer below should be a video and not an image as in this case. and also when the mouse is clicked and dragged it should create a cut and not making the layer above to disappear completely.
this is the code:
...is that a question? What is your question?
no jeremydouglass sorry, this was a reply to TfGuy44. but thank you for your comment.
anyway my question (in the first comment) is if there is a way to achieve a two layers sketch in which the one in the foreground could be cut, enabling to see the layer in the background.
@giu --
Yes, there is a way to see through a foreground layer to a background layer. See my answer above about PImage transparency.
Yes, you can modify the foreground layer (drawing, erasing, cutting) to change what can be seen through. Instead of PImage, use PGraphics.
To see some related examples from past discussions:
Off topic, but I just remembered an interesting homage to Lucio Fontana that was written in the Context Free language. The sketch is up here: