I am creating a slider control, I have problems setting the value though
_x = 512;
_y = 256;
_width = 128;
_height = 12;
_min = 0;
_max = 10;
I do something like,
// set the value
_input = 5;
_value = median(_x-(_width/2)+(_input/_max),_x-((_width/2)),_x+((_width/2)))
Setting the _input to 5 should put the slider in the middle, but it doesn't, I think I have the calculation wrong in some way.
_x-(_width/2) will give you 0 in percent, 0 in value
_x+(_width/2) will give you 100 in percent, 10 in value. The max.