Hi!
Recently I stumbled over G4P and I love it! Ta so much, Peter, for this fine library! Especially the gui-builder is a knock-out (and in my case it knocked out ControlP5, which, to the best of my knowledge, lacks a graphical builder). I was able to build the most recent project with G4P very satisfactorily! However, a couple of effects occured. (I’ll post single topics.)
perspective()
When yu change the perspective of your scene, the G4P-elements seem to bee unaware of that. This means that the gui-elements appear elsewhere on the screen, but the event procedures are fired at the “original” pixel positions.
Code to show behaviour:
Main tab:
import g4p_controls.*;
public void setup(){
size(480, 320, P3D);
createGUI();
// Wide angle "lens" (with 90° field of view):
// The button appears smaller and closer to the centre of the stage, but the
// "reaction zone" remains at its place. This renders it basically unusable.
perspective( PI/2, (float)width/(float)height, 3, 1000);
// Comment line 14 to check against default perspective with fov 60°.
}
public void draw(){
background(230);
translate( width/2, height/2 );
rotateX( PI/4 );
rotateY( PI/6 );
box( 100, 100, 100 );
}
Tab gui (from builder):
public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:590660:
println("button1 - GButton >> GEvent." + event + " @ " + millis());
println( "Button pressed." );
} //_CODE_:button1:590660:
public void createGUI(){
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setMouseOverEnabled(false);
surface.setTitle("Sketch Window");
button1 = new GButton(this, 22, 22, 80, 30);
button1.setText("Face text");
button1.addEventHandler(this, "button1_click1");
}
GButton button1;
If this is a bug or I’m missing something, I can’t tell.
The machine is running Manjaro Linux 23.1.3 with Linux Kernel 6.1.77-2-MANJARO. Processing is build no 1293, G4P 4.3.9.
Cheers, Mat