public class SpacingSlider extends Slider{ SpacingSlider(PApplet parent, Box b){ super(parent, b); minVal = 0; maxVal = 1; pos = 0.3; } void draw(){ super.draw(); textAlign(LEFT); textFont(meta12); fill(0.4); text("Spacing strength", round(b.left + textAscent()*.5), round(yPos - textDescent()*2)); if(b.containsMouse() || grabbed){ textAlign(CENTER); text(getPosition(), xPos, yPos+6+textAscent()); } } float getPosition(){ float p = lerp(minVal, maxVal, pos); return pow(p,2); } }