Is this possible in Processing to display a shape or an image outside of the boundaries of the sketch window? Is that something regular Java can do?
Thank you!
Is this possible in Processing to display a shape or an image outside of the boundaries of the sketch window? Is that something regular Java can do?
Thank you!
Iām leaning very much towards āNo, that is not possible.ā, mainly because it would be a major security concern.
It shouldnāt be possible to Display Pixels outside the Sketch, But you can create a Second āwindowā and make the surrounding bounds āinvisibileā and apply the background from your Screen Image to that window as background and create your shape there, But it is very complicated to do and might not really be what you are looking for.
Edit : wasnāt sure if this is possible, But apparently you can also set the Shape of the window, so you donāt Need to change the background to what is behind the screen displayed (which might cause some problems). Note that this is very difficult to do, if you donāt know what youāre doing and might cause a lot of Problems.
Hereās some code on how it works :
https://processing.org/discourse/beta/num_1245794206.html
Note that this was added to the official AWT classes since that post - eg. https://docs.oracle.com/javase/8/docs/api/java/awt/Window.html#setShape-java.awt.Shape-
Depending on whether the background is expected to keep updating there is also the āsolutionā used in the Swing Hacks book and elsewhere of a fullscreen undecorated window filled with a screen capture using Robot (Java Platform SE 8 )
All of this is going to be renderer dependent too. As far as I know it is possible to make a JOGL window transparent, but whether P2D / P3D let you access the required code to do that is another matter!
Thanks! I didnāt know about shaped or translucent windows.