double slidepos;
int slideamount;
if (grabbed)
{
if (ymouse > maxy)//replace maxy with slider's position at the bottom of the bar
{
yscreen = maxy;
}
else if (ymouse < miny)//replace miny with slider's position at top of screen
{
yscreen = miny;
}
else
{
yscreen = ymouse;
}
}
//that should let you drag slider up and down the bar
//next you need script to position the window. you can either move view or the window background.
//if the window size remains constant, you can precalculate some of these values, otherwise, you'll need to put them in script.
slidepos = (yscreen - miny) / (maxy - miny);
slideamount = window.height - view.height;
window.yscreen = (slidepos * slideamount) + (window.height * .5 - view.height * .5);
Users browsing this forum: No registered users and 1 guest