how to make an element unaffected by moving peasycam?

edited November 2014 in Library Questions

Hello,

I was wondering if there is a way that you make a button (or a controlP5 slider or whatever) remain in the initial position even if you are moving the Peasycam.

thanks

Answers

  • Answer ✓
    ControlP5 cp5;
    PeasyCam pcam;
    
    void setup(){
      size(300,300);
      cp5 = new ControlP5(this);
      pcam = new PeasyCam(this);
      // Other stuff 
      cp5.setAutoDraw(false);
    }
    
    void draw(){
      // Drawing stuff
    
    
      hint(DISABLE_DEPTH_TEST);
      pcam.beginHUD();
      cp5.draw();
      pcam.endHUD();
      hint(ENABLE_DEPTH_TEST);
    } // End of draw method
    

    Alternatively use G4P it does this automatically. See them in action here

Sign In or Register to comment.