decimal point on variables controlled by sliders

Apr 14, 2016

Hi heroes.

I have a slider controlling a variable. The variable equals the slider position. So if the slider position is 0.5 the variable equals 0.5. I have the variable reference on the screen for people to see.

Now what I am wondering is, is there a way to get it to say 1.0 instead of 1? It just looks very jumpy going from 0.5 to 1 to 1.5 to 2 and so on.

4 Replies
Kevin Thorn

Hi Lauren,

To get your slide to be smooth, increase the number of steps.

For example, if you have five main stops where your slider variable will be evaluated (change the state of an object, show a layer, etc.), set values to whole numbers then multiply total number of steps to say, 50. 

Your slider will still calculate each step but only your trigger will fire based on a single value or range of values within that slide.

Note: Max slider steps is 9999

David Schwartz

If I understand it, you want to essentially pad the value to add the decimal when it is not there. I don't know that there is any way other than Javascript. I'm in the baby steps of learning it, but I got it to work.

Essentially, it takes the value of the slider and divides by 1; if there is no remainder (a whole number) it pads it with ".0" and puts the result in a new text variable.

On the example, I have the new variable showing at the top, and the original slider variable below it.

Unfortunately because it is Javascript, you can't preview the slide within Storyline.

http://s3.amazonaws.com/tempshare-stage.storyline.articulate.com/stp1agal04f28abj241qkiek6u1l4/story.html

 (I realized after publishing that I should have set the initial value of the new variable dispCount to "0.0". It will look better that way.)

This discussion is closed. You can start a new discussion or contact Articulate Support.