Hi I was trying to run the following example in android mode using the ControlP5 Icon which I extracted from the example folder:
import controlP5.*;
ControlP5 cp5;
void setup() {
size(800,400);
cp5 = new ControlP5(this);
cp5.addIcon("icon",10)
.setPosition(100,100)
.setSize(70,50)
.setRoundedCorners(20)
.setFont(createFont("fontawesome-webfont.ttf", 40))
.setFontIcons(0x00f205,0x00f204)
//.setScale(0.9,1)
.setSwitch(true)
.setColorBackground(color(255,100))
.hideBackground()
;
}
void draw() {
background(220);
}
void icon(boolean theValue) {
println("got an event for icon", theValue);
}
It works well in java mode. In android mode, it fails to load the font file located in the data folder. Is there a way to make it work in android mode? I like this toggle button. Or if you have ideas of any other round toggle button that you could share here, it will be very welcome.
Thanks and cheers,
Kf