We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Pages: 1 ... 11 12 13 14 15 ... 17
controlP5 (Read 126738 times)
Re: controlP5
Reply #180 - Feb 4th, 2010, 12:51pm
 
Hello,

I really love this library. Thanks!

I was wondering, though, if it's possible to place a textarea in an external controlWindow.  I've tried using
textarea.setWindow(controlWindow);
but to no avail.  Is this a possibility yet?

Re: controlP5
Reply #181 - Feb 5th, 2010, 4:18pm
 
hi colinz, to move a textarea to another controlWindow use moveTo(). you can use moveTo to move controllers and groups to other tabs, groups, or controlWindows.
Code:

controlWindow = controlP5.addControlWindow("myWindow",100,100,400,200);
myTextarea = controlP5.addTextarea("label1", "a textarea", 10, 10, 200, 60);
myTextarea.moveTo(controlWindow);


andreas

The return of the ellipseMode bug
Reply #182 - Feb 8th, 2010, 7:47am
 
Hi,

I just downloaded controlP5, and there seems to be a more sneaky variant of the old ellipseMode bug there. look at this please:

Code:
import controlP5.*;

void setup() {
 ellipseMode(CENTER);
 println(g.ellipseMode);

 fill(128);
 ellipse(50, 50, 50, 50);

 new ControlP5(this);
}

void draw() {}

void mousePressed() {
 println(g.ellipseMode);
 fill(255);
 ellipse(50, 50, 50, 50);
}


I looked in the ControlWindow code, and you fixed it there, but somehow onMousePressed it's back. Shocked

cheers
alvaro
Re: controlP5
Reply #183 - Feb 8th, 2010, 8:02am
 
hi, i took a look at the code above. works for me, in both cases (setup and mousePressed), the ellipseMode is 3 (CENTER) and the ellipse is drawn accordingly. any hint what oddities you encounter?
Re: controlP5
Reply #184 - Feb 8th, 2010, 10:45am
 
OK it works!

I checked out ControlP5 from source and built it. Problem solved. But the 0.4.5 version I was using before still had the bug. thanks.
Re: controlP5
Reply #185 - Feb 8th, 2010, 1:22pm
 
great. 0.4.5 indeed had this problem, was fixed with 0.4.6
Re: controlP5
Reply #186 - Feb 8th, 2010, 5:15pm
 
Hi sojamo and others,

I have some troubles with setWindows
I reach easily to put some sliders to a second window with setWindow(), but how draw some bezierVertex in this?

Must I use a class for this?
Can we do a kind of beginShape().setWindow(controlWindow)?

Anyway, thanks a lot for this great library!
Re: controlP5
Reply #187 - Feb 17th, 2010, 1:48am
 
Hey Sojamo and all,

many thanks for the compelling library, really nice to work with, even for me not being a programmer Wink

I have a very basic shameful question.
I would like to set the value of a bunch of sliders continuously. I gave the sliders different names and I was gonna use the setValue() method. The code is trivial and goes more or less like this:

Code:
 
sliders_easing = new ControlP5(this);
for(int i=1;i<=num_dimensions;i++){
String name=Integer.toString(i);
 sliders_easing.addSlider(name,0.,1.,0,30+120*(i-1), 20,10,75).setId(-i);
}

for(int i=1;i<=num_dimensions;i++){
String _name=Integer.toString(i); //my slider are called "1", "2" and so on
 
  sliders_easing.controller(_name).setValue(weigths[i]); // get the values from an array
}


for some reason i get a nullpointer exception. am i doing something conceptually wrong or it should work?
I think i really miss something about setting values outside the controlEvent...

thanks in advance,

roberto

Re: controlP5
Reply #188 - Feb 17th, 2010, 7:59am
 
Hello sojamo,

I am using the controlP5 with PeasyCam and its HUD.

I have
controlP5.draw(); within
cam.beginHUD();
cam.endHUD();  
within draw.

Now I switched from P3D to OPENGL.

Since I did that, I have the textarea doubled.
Which is bad.

One is in the HUD, one is not.

Can I switch off some auto-draw for controlP5?

Thank you so much!

Chris


Re: controlP5
Reply #189 - Feb 17th, 2010, 8:02am
 
Yes, set this in your setup of the ControlP5.
controlP5.setAutoDraw(false);
Re: controlP5
Reply #190 - Feb 17th, 2010, 9:04am
 


That was quick!

And exactly right!

I was already searching the help area, but yet to no avail.

You helped me a lot!

Thank you!

Chrisir

Re: controlP5
Reply #191 - Feb 20th, 2010, 8:19am
 
That's my favorite P5 library of all times. I like it so much that when making my Actionscript GUI lib I took inspiration from this one.
Re: controlP5
Reply #192 - Feb 21st, 2010, 9:35pm
 
Hi Processing Community,

I'm new and have been learning thanks to these forums!

I am attempting to use the ControlP5 library to create a dropdown menu.

I have successfully done so, however, the drop-down box is dropping OVER the menu tab. I would like it behind. I played around with a Z coordinate, but didn't have much luck.

I started this project using the ControlP5ControlFont Example.

Would it be possible for anyone familiar with this library to suggest a way to resolve this?

Thanks so much for your time!!

--
Ayari


import controlP5.*;
import processing.opengl.*;

ControlP5 controlP5;
ControlFont font;
controlP5.Button buttonOne;
int buttonValue = 1;
boolean isOpen;
int myColorBackground = color(0,0,0);

void setup() {
 size(640,480, OPENGL);
 smooth();

 controlP5 = new ControlP5(this);
 
 // (1)
 //Button A
 //(name, value, x, y, lengh, width)
 controlP5.addButton("ButtonA",10, 100,0,80,20).setId(1);
 buttonOne = controlP5.addButton("Button A Value",10,100,300,80,20);
 
 // Set the Color of buttonOne
 buttonOne.setColorActive(color(255));
 buttonOne.setColorBackground(color(132));

 //buttonOne.position().z = -50;
 buttonOne.setId(2);
 buttonOne.setWidth(200);
 buttonOne.setHeight(200);
 
 
}
void draw(){
 background(0);
   
 //Animation Button A
  buttonOne.position().y += ((isOpen==true ? 20:- 200) - buttonOne.position().y) * 0.2;
  println("Position Z is: " + buttonOne.position().z);

}

public void controlEvent(ControlEvent theEvent) {
 println(theEvent.controller().id());
}

public void ButtonA(float theValue) {
 println("a button event. "+theValue);
 isOpen = !isOpen;
 controlP5.controller("ButtonA").setCaptionLabel((isOpen==true) ? "Open":"Close");
}



Re: controlP5
Reply #193 - Feb 22nd, 2010, 7:44am
 
the hierarchy of drawing controllers depends on when a controller has been added to controlP5. if you put
Code:
buttonOne = controlP5.addButton("Button A Value",10,100,300,80,20); 


before

Code:
controlP5.addButton("ButtonA",10, 100,0,80,20).setId(1); 



you should get what you are looking for, but i realize it would make sense to add a z-sorting feature.
best,
andreas
Re: controlP5
Reply #194 - Feb 22nd, 2010, 10:25am
 
Brilliant!
Thank you Andreas! It works!
Pages: 1 ... 11 12 13 14 15 ... 17