# G4P - playable preview of next version

**URL:** <https://discourse.processing.org/t/g4p-playable-preview-of-next-version/6628>\
**Category:** Gallery\
**Created:** [December 15, 2018, 4:26pm UTC](https://discourse.processing.org/t/g4p-playable-preview-of-next-version/6628 "2018-12-15T16:26:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 15, 2018, 4:26pm UTC](https://discourse.processing.org/t/g4p-playable-preview-of-next-version/6628/1 "2018-12-15T16:26:55Z")

</div>

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](http://lagers.org.uk/g4p/guides/g13-views.html) 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.

[![](https://img.youtube.com/vi/Bujc5vyuWrs/hqdefault.jpg "GView control in G4P") ](https://www.youtube.com/watch?v=Bujc5vyuWrs)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [December 17, 2018, 9:48pm UTC](https://discourse.processing.org/t/g4p-playable-preview-of-next-version/6628/2 "2018-12-17T21:48:48Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 17, 2018, 9:57pm UTC](https://discourse.processing.org/t/g4p-playable-preview-of-next-version/6628/3 "2018-12-17T21:57:25Z")

</div>

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.
