How to make a scroll bar that adjusts a variable

I found out, but not sure how to delete this post. Anyhow, it seems this works, I just didn't see the class HScrollbar and thus my program was saying the class didn't exist. I thought HScrollbar was like PImage in that it was something in the basic Processing library. OOPS! https://processing.org/examples/scrollbar.html

Answers

  • edited November 2016

    An HScrollbar is an object, defined by the code in the example. A complete definition of what an HScrollbar is right there in the code you linked to, starting with the line

    class HScrollbar {
    

    So, for example, if you wanted to make a DooHickey, you would do it like this:

    DooHickey dd;
    
    void setup(){
      dd = new DooHickey();
      dd.print();
    }
    
    class DooHickey{
      DooHickey(){}
      void print(){
        println("doo-hickey!");
      }
    }
    

    If Processing was confused, you probably did not copy all of the code from the example into your sketch.

    Edit: Looks like you figured this out while I was posting the answer. In general, built in special objects will start with P for Processing (PShape, PImage, PVector). The only exceptions are acronyms like JSON and XML.

Sign In or Register to comment.