My goal is simply to be able to resize a ControlP5 text field when the window is resized.
import controlP5.*;
ControlP5 cp5;
void setup(){
size(1080, 640);
background(197,217,227);
surface.setResizable(true);
cp5 = new ControlP5(this);
cp5.addTextfield("pyrolysisChamberFanRPMControl")
.setPosition(30 + width / 16, 2 * (width / 6) + 30 + (width / 60))
.setSize(width / 8, width / 60)
.setFont(font)
//.hide()
.setCaptionLabel("Pyrolysis Chamber Fan Control")
.setColor(color(255, 2, 141))
.setColorBackground(color(167,187,207))
.setColorCaptionLabel(color(255, 2, 141))
.setColorActive(color(107,157,167))
;
}
void draw(){
cp5.get(Textfield.class,"pyrolysisChamberFanRPMControl")
.setPosition(30 + width / 16, 2 * (width / 6) + 30 + (width / 60))
.setSize(width / 8, width / 60)
.updateSize()
;
}
This code excerpt properly resizes the text box to where I want it to go, however, (1) I can no longer click inside the box and enter a value. And (2) if I force the ability to enter a value with setFocus() the entered value does not scale. In other words, the font for both the entered value and the label text remains the same size as it was with the original window size.
Thanks,
Hawk