The windowRatio() method and its associated variables rwidth, rheight, rmouseX, rmouseY are demonstrated in the release notes for Processing 4.0 beta 7 with the code below but we don't yet have an example built-in.
void setup() {
windowResizable(true);
windowRatio(1280, 720);
cursor(CROSS);
strokeWeight(10);
}
void draw() {
background(240);
fill(255);
rect(0, 0, rwidth, rheight);
fill(0);
textAlign(CENTER, CENTER);
textSize(200);
text(rmouseX + ", " + rmouseY, rwidth/2, rheight/2);
}