Ah, in my sleep deprived brain I forgot to mention that I haven't had a problem getting the scrollbar to move, but it's the fact that it stores a value, from say 1 to 10, and I can't get it to update said value easily.
This is my code so far...
if GetRawMouseLeftState()
s.scrollbar.xPos = GetPointerX()
// set the sprite position of the scrolly bit
SetSpritePosition(s.scrollbarID, s.scrollbar.xPos, s.bounds.yPos)
if s.scrollbar.xPos + GetSpriteWidth(s.scrollbarID) >= s.scrollbar.width then s.scrollbar.xPos = s.scrollbar.width - GetSpriteWidth(s.scrollbarID)
s.curValue = s.scrollbar.xPos / s.maxValue
// clamp the value
if s.curValue >= s.maxValue then s.curValue = s.maxValue
if s.curValue <= s.minValue then s.curValue = s.minValue
Print (str(s.curValue))
endif
Let's say that scrollbar/slider in particular controls the sound volume. So, dragging it to the right would increase the value, dragging it to the left would decrease. This is the line that I am specifically having trouble with:
s.curValue = s.scrollbar.xPos / s.maxValue
That kinda works, but it doesn't take into account the width of the scrollbar track, or the position of the scrollbar. It only works if the size of the slider is 100, and positioned at x0. So... how do I fix that

Slowly compiling code, one byte at a time.
Follow meh blague for more zany thoughts and possibly offensive programming!