Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

ControlP5 Icon Example not running in android

$
0
0

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


Viewing all articles
Browse latest Browse all 941

Trending Articles