Slider question

Discuss any other topics here
Post Reply
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Slider question

Post by AndyCR »

im having trouble with sliders in rf2. if i follow the manual to the letter, the slider only goes about 3/4ths the way of the slider background, and yet in rf1 the same ini works perfectly. heres the code to calculate the valid moveable area of the slider:

rCalculatedValidArea = rect<s32>(p2dSliderPosition.X + iMinX, p2dSliderPosition.Y, p2dSliderPosition.X + iMaxX, p2dSliderPosition.Y + itSliderImage->getOriginalSize().Height);

(it more or less ignores y, so don't worry about that) the maximum position going left is the position of the slider (defined in menu.ini) plus the minimum value specified in the ini, and the maximum position is the slider's positiion defined in the ini plus the maximum value specified in the ini. the manual says:

min_X is the distance from screen_X that the graphic stops moving in the left direction,
and max_X is the distance from screen_X that the graphic stops moving in the right direction.

am I doing anything wrong? thanks.

EDIT: Never mind, I just had to add the width of the slider image to the maximum x value.

EDITEDIT: Never mind. It went too far off to the side then, but i removed the add the width of the image code and now it's perfect. don't mess with it, dont ask dont tell, i suppose.
Post Reply