Scaling affected mouse event in GUI components created using G4P!

edited June 2014 in Library Questions

I created GUI buttons using G4P libraries. Then, used scale() in draw() function. GUI buttons are scaled down correctly. But hovering over the mouse buttons, seems not working correctly. Help me!

Tagged:

Answers

  • Do not use scale(), rotate() or translate() to change the size/position of G4P controls because these do not change the mouse position reported by Processing. If you want to use these commands for your drawing then use push and popMatrix like this.

    void draw(){
      pushMatrix();
      // your drawing commands e.g. scale() etc.
      popMatrix();
    }
    
Sign In or Register to comment.