How can I resize my sketch when using ControlP5 Buttons.

edited February 2018 in Library Questions

I'm very new to processing so please excuse my lack of proper terminology. When I open this sketch and move my mouse over the buttons they highlight and work as expected. When I make the screen much larger all appears ok except when I move my mouse over the buttons they no longer highlight and work unless I move my mouse to what appears to be the old unscaled location of the buttons. Any Idea how to fix this?


This is my code. Hope I'm posting it right.

import controlP5.*;
ControlP5 cp5;

PFont font1;

void setup() {

  size(500, 500);

  font1 = createFont("Ravie", 20, true);   

  cp5 = new ControlP5(this);
    .setCaptionLabel("Button 1")
    .setPosition(100, 200)
    .setSize(125, 50)
    .setPosition(100, 350)
    .setSize(125, 50)

void draw() {

  scale( width/500.0, height/500.0);



Sign In or Register to comment.