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

ControlP5: Keep the value label placement steady at a certain place for a vertical slider?

$
0
0

Heyy! I am using ControlP5 for project! Anybody know how to keep the value label placement steady at a certain place for a vertical slider? Default it is set to follow the bar within the slider as you can see in my code, but I would like it to just stay at its starting position and not follow the bars movement.

import controlP5.*;

ControlP5 cp5;

int front = color(90); int back = color(190); int LabelColor = 100;

void setup() { size(600, 450); PFont font = createFont("arial", 20); cp5 = new ControlP5(this); cp5.addSlider("LodretFlyendeKnap") .setPosition(210, 200) .setSize(20, 200) .setRange(0, 100) .setDecimalPrecision(0) .setValue(50) .setFont(font) .setColorActive(front) .setColorBackground(back)
.setColorValueLabel(100) .setColorForeground(front) .setCaptionLabel(" ") .setSliderMode(Slider.FLEXIBLE) ;

// reposition the Label for controller 'slider' cp5.getController("LodretFlyendeKnap").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(25); cp5.getController("LodretFlyendeKnap").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingY(-200); cp5.getController("LodretFlyendeKnap").getCaptionLabel().align(ControlP5.RIGHT, ControlP5.BOTTOM_OUTSIDE).setPaddingX(0); }

void draw() { background(255); }


Viewing all articles
Browse latest Browse all 2896

Trending Articles