Skip to reading
Images, Carousels & Choice Controls

Choose a sensible range and step

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
Source table from Choose a sensible range and step, page 29
SettingExampleMeaning
Minimum0Lowest allowed value.
Maximum100Highest allowed value. Keep it greater than Minimum for a useful range.
Value75Authored starting value, clamped to the range during construction.
Step5The increment between allowed values: 0, 5, 10 and so on.

Step is a numeric increment, not a speed or a delay. Use Step 1 for whole-number choices. Use a fractional step, such as 0.05, when the range is 0 to 1 and small changes matter.

Code example
0 to 100 display scale:
Minimum 0, Maximum 100, Step 5
Code example
0 to 1 fractional scale:
Minimum 0, Maximum 1, Step 0.05

The control’s live value is numeric and can be a floating-point value. Read it as a float in scripts, even if this particular range uses whole steps. Convert to an integer only when the gameplay rule needs a whole number.

A slider’s caption does not bind it to an engine setting. A slider called Volume still needs an audio workflow; one called Opacity needs an action that applies the value to an Image.

A zero-length range cannot provide a useful drag choice. Start with a small practical range, test both ends, then adjust the step for the amount of precision the player actually needs.

Page 29 of 52Permalink
Go to page