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.