Help Me Get SliderPack Values please! Thank You!
-
@Chazrox sp2values is an array so it's working correctly
-
@d-healey How do I print out all the individual values?
-
@Chazrox said in Help Me Get SliderPack Values please! Thank You!:
SliderPack2.getSliderValueAt(i)
-
@d-healey How come its not working for me? It just says "Array" .
-
-
@Chazrox because your trying to print the array, Console.print only prints strings, so you need to either print the value in the loop where you're getting it or convert the array to a string
-
@d-healey help please.
Im trying to push these numbers to a globally declared array so I can save it to my preset menu. I found a thread where you talked about having to deal with .getSliderValueAt(); within the onControl callback so Im trying this now.
Does this still work? I know that was an old thread.
function onControl(number, value) { local numSliders = SliderPack2.getNumSliders(); for (i = 0; i <numSliders.length; i++) { sp2Values.push(SliderPack2.getSliderValueAt(i)); //Value gives you the index of the slider } Console.print("Index: " + value + " Slider Value: " + sp2Values); }
-
@Chazrox Console.print(trace(yourArray)) ;
-
Maybe this helps explain it better
const n = 10; Console.print(n); // 10 const s = "Hello"; Console.print(s); // Hello const a = [1, 2, 3] Console.print(a); // [array] Console.print(a[0]); // 1 Console.print(trace(a)); // [1, 2, 3]
Trace converts an array or object to a string.
-
@d-healey I Love a good cheat sheet! Thank You!