Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouse-over detection not working for repsonsive window layout #175

Open
jango-fx opened this issue Nov 18, 2021 · 0 comments
Open

mouse-over detection not working for repsonsive window layout #175

jango-fx opened this issue Nov 18, 2021 · 0 comments

Comments

@jango-fx
Copy link

if i make the window resizable and change the position of my controls relative to the new window size, they stop working (as long, as the window size differs from startup).

import controlP5.*;

int windowWidth, windowHeight;

ControlP5 cp5;
Toggle toggle;

void setup()
{
  surface.setResizable(true);
  registerMethod("pre", this);

  cp5 = new ControlP5(this);
  toggle = cp5.addToggle("check");
}

void pre() {
  if (windowWidth != width || windowHeight != height) {
    windowWidth = width;
    windowHeight = height;
    toggle.setPosition(width/2-20, height/2-10);
  }
}

void draw()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant