How I get the values from slider to show in text and take it to calculate?

edited January 2016 in Library Questions

Hi, guy. I use slider from Simple Multi-Touch (SMT) library, I want to get the value in current to show in text and take it to calculate. But I can't get it, how should I do? Help me, please.

get code from

Capture1 this I tried to edit but it miscarry.

Or do you have a better way to be introduced to me?



  • edited January 2016

    It would be helpful to know what version of Processing your using and to display the code you've written.

  • @SiriusCG I using Processing v.2.2.1 This's my code

    import vialab.SMT.*; int currentValue; void setup() { size(400, 400, SMT.RENDERER); SMT.init(this, TouchSource.AUTOMATIC); SMT.add(new SliderZone("Slider",100,100,200,50,currentValue,0,100,5,10,"Label")); } void draw() { background(79, 129, 189); text("Current value is : "+currentValue,50,50); } void touchUpSlider(SliderZone s, Touch t){ println(s.getCurrentValue()); }

  • Thank you. I don't have 2.2.1, but here's a hint: it appears the integer value you want is found in "s.CurrentValue()". What else can you do with that value beside print it?

Sign In or Register to comment.