[ControlP5] DropUpList or only DropDownList?

edited September 2014 in Library Questions

hey, is it possible to make a DropUpList? ;))

import controlP5.*;
ControlP5   cp5;
DropdownList l; 

PFont myFont;
void setup() {
  size(200, 200);
  cp5 = new ControlP5(this);

  String[] fontList = PFont.list();
  myFont = createFont(fontList[422], 20);

  l = cp5.addDropdownList("myList")
    .setPosition(100, 100)
      ;
  for (int i=0; i<fontList.length; i++) {
    l.addItem(fontList[i], i);
  }
}

void draw() {
  background(0);
}

Answers

  • I don't think it has support for that natively. You can look at the source code and create a class DropUpList which extends DropDownList and overrides its display or draw method.

  • Don't forget to choose a proper category for your messages. I moved them for you, but I prefer to avoid this extra work.

  • srry, PhiLho. i forgot it.

Sign In or Register to comment.