GiCentre SketchPanel sizing
in
Contributed Library Questions
•
2 years ago
Hi,
Been playing with gicentre library
http://gicentre.org/utils/ specifically "Embedding Sketches in a Single Window" as SketchPanels, same as example on site. Got it running fine but can't set sizes of the assorted sketches.
Eg something like following, assuming different size is called in each of the subclasses. Only seems to divide the screen equally in two based on the initial size(800, 480) calling function, doesn't do what you tell it from the subclasses. Is there a way of doing it. IE I have one side as 640*480 and the other as 160 * 480, stick video stuff in one and controls in another. All works but sizing of the panels doesn't.
Using PopupWindow() different sizes happen okay although still to figure how to place them on the screen so you can see them all.
Is it possible to force an X size instead of default of half?
Thanks
Stefan
void setup()
{
size(800,480);
setLayout(new GridLayout(0, 2));
noLoop();
PFont font = createFont("Serif",32);
textFont(font, 32);
smooth();
textAlign(CENTER,CENTER);
fill(120,20,20);
rotationAngle = 0;
ASketch sketch1 = new ASketch();
AnotherSketch sketch2 = new AnotherSketch();
SketchPanel sp1 = new SketchPanel(this, sketch1);
add(sp1);
sketch1.setIsActive(true);
SketchPanel sp2 = new SketchPanel(this, sketch2);
add(sp2);
sketch2.setIsActive(true);
}
{
size(800,480);
setLayout(new GridLayout(0, 2));
noLoop();
PFont font = createFont("Serif",32);
textFont(font, 32);
smooth();
textAlign(CENTER,CENTER);
fill(120,20,20);
rotationAngle = 0;
ASketch sketch1 = new ASketch();
AnotherSketch sketch2 = new AnotherSketch();
SketchPanel sp1 = new SketchPanel(this, sketch1);
add(sp1);
sketch1.setIsActive(true);
SketchPanel sp2 = new SketchPanel(this, sketch2);
add(sp2);
sketch2.setIsActive(true);
}
1