You can use p5 with android. It is however pretty heavy. I wouldconsider making my own buttons etc. Here's an example of a simple button:
// Usage:
// Button b_1;
//
// void setup() {
// b_1 = new Button(xPos, yPos, _width, _height, "label", 2);
// }
//
// void draw(){
// if (b_mode.clicked){
// // do stf
// b_1.display();
// }
//////////////////////////////////////////////////////
Answers
You can use p5 with android. It is however pretty heavy. I wouldconsider making my own buttons etc. Here's an example of a simple button: // Usage: // Button b_1; // // void setup() { // b_1 = new Button(xPos, yPos, _width, _height, "label", 2); // } // // void draw(){ // if (b_mode.clicked){ // // do stf // b_1.display(); // } //////////////////////////////////////////////////////
class Button { /* --- GLOBAL VARIABLES --- */
float x, y, w, h; String label; boolean MOVER = false; boolean BDOWN = false; boolean clicked = false; int textSize = 0;
/* --- CONSTRUCTOR --- */
Button(float _x, float _y, float _w, float _h, String _label, int _textSize) { x = _x; y = _y; w = _w; h = _h; label = _label; textSize = _textSize; }
/* --- METHODS --- */
void display() { // Needs to be first if(BDOWN && MOVER && !mousePressed) { clicked = true; } else { clicked = false; }
} }
please edit message, highlight code, hit ctrl-o
I have modified the discussion title to make it more relevant to the topic.