slider.valueForPoint(value)

Takes a point and returns the corresponding value of the slider. With a width of 200, the valueForPoint(100) will be the center of the slider. With a slider ranging from 0 to 1, this will return 0.5.
译:需要一个点并返回滑块的相应值。用宽度200 , valueforpoint(100)将滑块中心。与一个滑块,从0个到1个”,这将返回0.5”。

# Create a SliderComponent 
slider = new SliderComponent
    width: 200

slider.center()

# Print the value for the point 100 
print slider.valueForPoint(100)
# Returns 0.5

results matching ""

    No results matching ""