Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

controlP5 and opengl incompatibility. how to solve?

$
0
0

Hello. Basically I figured out what was making the backspace not work properly on a textfield on my code. If i use opengl which I need, I'm not able to keep pressing backspace to delete the text all at once. Instead I need to press and release, press and release etc... Is there any workaround? Everything else works fine (on my main code) like getting the strings from the textfields by pressing buttons etc.

Not functional with opengl

  import controlP5.*;
  import processing.opengl.*;
  ControlP5 caixas;
  Textfield selected;

  void setup() {
     size(600, 400,OPENGL);

    caixas = new ControlP5(this);

    selected = caixas.addTextfield("Name").setPosition(20, 200).setSize(200, 40)
    .setAutoClear(false)
    .setFont(createFont("Calibri", 17))
    .setColorActive(color(255));
  }
  void draw() {
        background(0);
  }

Fully functional without opengl

  import controlP5.*;

  ControlP5 caixas;
  Textfield selected;

  void setup() {
     size(600, 400);

    caixas = new ControlP5(this);

    selected = caixas.addTextfield("Name").setPosition(20, 200).setSize(200, 40)
    .setAutoClear(false)
    .setFont(createFont("Calibri", 17))
    .setColorActive(color(255));
  }
  void draw() {
        background(0);
  }

Viewing all articles
Browse latest Browse all 2896

Trending Articles