LavishGUI:variableslider (Element Type)

From Lavish Software Wiki
Jump to navigation Jump to search

Introduction

What is a Variable Slider?

A variable slider is a slider that modifies data when it is scaled.

Using Variable Sliders

Variable Sliders are descendants of the slider element type. Any attributes of the slider element type may be applied in addition to the variable slider-specific properties described below.

Variable Slider-Specific Properties

  • Data
Variable to use for display, and to modify when the slider is moved
  • Offset
This value will be subtracted from the value of the variable when converting to the slider's value
  • VariableRange
After subtracting from the offset, the value of the variable will be divided by this number, and then multiplied by the slider's range to become the slider's value. The slider can then use intervals directly proportional to the variable range, rather than equal to (allowing, for example, a variable that should be set between 0 and 100 to only be set to 0, 20, 40, 60, 80, or 100 by using a slider range of 5, and a variable range of 100)

Examples

Example code

	<variableslider name='TestVariableSlider'>
		<X>130</X>
		<Y>125</Y>
		<Width>100</Width>
        	<Height>20</Height>
		<Range>5</Range>
		<VariableRange>100</VariableRange>
               Script[Test].Variable[TestPercent]
	</variableslider>

See Also