How about, give me a hint()?

edited May 2015 in How To...

Looking up stroke() in the reference reveals this:

When drawing in 2D with the default renderer, you may need hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of performance). See the hint() documentation for more details.

So, naturally I tried to look up hint() next, which does not exist. A search however revealed this little gem:

Posted by GoToLoop, December 2013:

Processing devs are trying to create an API official cannon! Things like hint(), thread(""), delay(), JAVA2D, etc. are to remain hidden from public view!

So, hint exists but is deemed 'top secret' so us peons don't hurt ourselves, or it does not and the help page is there as a social experiment to see how many people figure it is worth the time to post about? If so, does that mean I win?

A year and a half is a long time to stay out of step....

Tagged:

Answers

  • edited May 2015

    go to loop is just making a fuss...

    truth is that the reference page keeps it short and simple because it is a beginner language

    at the same time, processing is Java so you can use every java command (this also is not a secret but you can find this information throughout in the site, e.g. in the tutorials)

    so you can google hint() (and get to java docs, which is also referred to in the reference often)

    https://docs.oracle.com/javase/tutorial/2d/text/renderinghints.html

    ;-)

  • edited May 2015

    The reference is not completely, uh, complete. For a complete reference, check out the API: http://processing.org/reference/javadoc/core/

    Processing is also open source, so you can consult the source directly: https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java

    Look at line 9971 of that class to see the hint() function in its entirety:

    public void hint(int which) {
        if (recorder != null) recorder.hint(which);
        g.hint(which);
     }
    

    The g variable there is an instance of PGraphics, so we can look that up in the API here.

    There you have all the information you need about the hint() function.

    Note that the API also contains documentation on the functions GoToLoop says are a secret: here is the thread() function, and here is the delay() function. For that matter, the thread() function is in the regular reference here.

  • edited May 2015
    • That was said about 1.5 years ago!
    • Very recently, they've finally added thread("") to the official repertoire.
    • But they still hides its cousin method(""), which does the same but w/o forking a Thread.
    • In the old days both hint() & delay() were present in the reference.
    • But for some years now, they've censored their existence.
    • Problem is it exists in Arduino and folks know that it exists in Processing.
    • And b/c information was hidden from us, most folks dunno how to use it properly and I have to correct them all the time.
    • It would immensely ease our answerer job if folks were more informed, w/ those useful hidden API explained, so we don't need to teach them all the time over & over!
Sign In or Register to comment.