[controlP5] checkbox with image
in
Contributed Library Questions
•
1 year ago
Hi all! I'm trying to create a checkbox, using a set of images to show is status. I'm encountering two problems:
- i'm not able to show a label describing the item
- when i click on the checkbox, i get the error: java.lang.NoSuchMethodException: chkbox_image.theChkbox(int)
Here's a simple code
Thanks,
Giovanni
- i'm not able to show a label describing the item
- when i click on the checkbox, i get the error: java.lang.NoSuchMethodException: chkbox_image.theChkbox(int)
Here's a simple code
- import controlP5.*;
ControlP5 myCP5;
void setup()
{
size(400,400);
myCP5 = new ControlP5(this);
PImage theImage = loadImage("check_box_active.png");
myCP5.addCheckBox("theChkbox")
.setPosition(30,20)
.setItemsPerRow(2)
.setSpacingColumn(50)
.setSpacingRow(30)
.setImage(theImage)
.setSize(theImage)
.addItem("First item", 1)
.addItem("Second item", 2)
.addItem("Third item", 3)
.addItem("Fourth item", 4)
;
}
void draw()
{
background(200);
}
Thanks,
Giovanni
1