   Scrollbar formula...
  Hi!Currently I am building in some Scrollbars into my level-editor. I must say: That is not easy! :P And after hours of trial-and-error, I think I could need some help with this.This is what I have:And another problem is, that the Scrollbar-drag-thingy has to resize itself, when more items are added (Get smaller). The formula I currently use is very stupid, and nonworking :(Here are some usable variables:BarPos: current position of the middle of the drag-thingyBarSize: Size of the drag-thingy (How to calculate it!?)ItemSize.y: Y size of the whole scrollbar control ScrollMaxY: The highest Y value of the controls to scrollWhen you say I need need more, I'll build in more! :PAny ideas?   
  This should be enough:the dark red is the window. I assumed in the image, that the height of the window is the same as the height (length) of the scrollbarh/h_full = h_scroll/hs/h_full = s_scroll/hYou can work out the variables you need (but man, this is some very basic stuff).   ;  Thx, I know that this is basic stuff, but somehow it always looks wrong.Gonna try again...EDIT: Erm.. When BarSize=h/h_full it is only one pixel. Could you tell me, what I have to assign where?Don't think that I am stupid, or not good in math. I really don't know why I can't beat those scrollbars :( :(   ;  BarSize = ItemSize.y * ItemSize.y / ScrollMaxY;BarPos = ItemSize.offset_whatever * ItemSize.y / ScrollMaxY + BarSize*0.5;If I haven't misunderstood the names.I guess you understand, that s and s_scroll (names according to the image posted by me) are not the same.   ;  Ok, much thanks! :)I got everything working now!   ;  Okay, I was prig.I had problems with scrollbars myself when making GUIs with Matlab. But I had an excuse: it's used the ratio of the "empty" stuff and the scrollbar size as parameter (h_scroll/(h-h_scroll)) :P But The math was the same anyway...   