G4P - playable preview of next version

This is a preview of the next version (4.2.0) of G4P and the latest control GView.

GView allows you to embed 2D or 3D views into your sketch. These views also respond to mouse events so they can be programmed to perform many different tasks.

The video below shows them in action. You can see the video full size on my website and there with a series of programming guides so you can get the most out of it.

You can also download the sketch used in the video from my website and play with it in Processing.

If you have any suggestions or comments on using the new control and / or the programming guides, they would be greatly appreciated.

7 Likes

Very nice. Great for control interfaces, games, and HUD applications. The self-contained demo sketch with no required install is a really nice touch!


One tiny suggestion: a bit surprising that the Random Line button doesn’t change the caption readout (because it is a readout of the mouse, not the line). Perhaps instead:

  public String getMousePositionText() {
    return "Line @ [" + sx + ", " + sy + ", " + ex + ", " + ey + "]";
  }
1 Like

Glad you like it.

It is a demo so I was trying to show as many mouse events as possible.

With the 2D view

  • the background colour changes on mouse-enters / mouse-exit
  • sx, sy are set on mouse-pressed
  • ex, ey are updated when on mouse-dragged and
  • the caption showing the mouse position is updated on mouse-move

it would be simple enough to have a second caption to show the line coordinates as you suggest.