processing-website icon indicating copy to clipboard operation
processing-website copied to clipboard

Please consider adding to the image() reference page

Open jpaley opened this issue 7 years ago • 1 comments

Issue description

image(img, dx, dy, dw, dh, sx, sy, sw, sh);

Drawing part of an image (from a sprite sheet, for example) is really important. It comes up in a forum response, but not in the documentation.

It can be found if (a) one assumes that it is doable despite missing documentation and (b) one Googles "how to draw part of an image in processing". I believe it ought to be part of the main documentation as I don't think this is an obvious assumption to make.

URL(s) of affected page(s)

Forum page:

https://forum.processing.org/one/topic/displaying-a-part-of-the-image.html

Reference page

https://processing.org/reference/image_.html

Proposed fix

Please consider putting the example from the forum on the reference page for image().

jpaley avatar Jan 16 '18 03:01 jpaley

We made a decision to include this feature in the JavaDoc reference, but not on the simplified reference. This is the function inside the source code:

/**
   * Draw an image(), also specifying u/v coordinates.
   * In this method, the  u, v coordinates are always based on image space
   * location, regardless of the current textureMode().
   *
   * @nowebref
   */
  public void image(PImage img,
                    float a, float b, float c, float d,
                    int u1, int v1, int u2, int v2) {
    if (recorder != null) recorder.image(img, a, b, c, d, u1, v1, u2, v2);
    g.image(img, a, b, c, d, u1, v1, u2, v2);
  }

Does anyone else feel this should be in the simplified HTML reference.

REAS avatar Jan 27 '18 02:01 REAS