slider.pointForValue(value)
Takes a value and returns the corresponding point (x) within the slider. With a slider ranging from 0 to 1, the pointForValue(0.5) will be the center of the slider. With a width of 200, this will return 100.
译:取一个值并返回滑块内的相应点(x)。一个滑块从 0 到 1 ,的pointforvalue (0.5)将滑块中心。有一个宽度为200的”,这将返回”100”。
# Create a SliderComponent
slider = new SliderComponent
width: 200
slider.center()
# Print the point for a value of 0.5
print slider.pointForValue(0.5)
# Returns 100