About Store Forum Documentation Contact



Post Reply 
How to change the minimum value in the slider?
Author Message
Babulesnik Offline
Member

Post: #1
How to change the minimum value in the slider?
I need to change the range of " 45..135 " but by default " 0..135 "
10-19-2011 09:01 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: How to change the minimum value in the slider?
Code:
value = Lerp(45, 135, slider());

What do you mean by "but by default 0..135?" Something like this?

Code:
value = Lerp((default ? 0 : 45), 135, slider());

'default' is a bool variable that you set to true when you want 0 and false when you want 45.
(This post was last modified: 10-19-2011 08:05 PM by Driklyn.)
10-19-2011 08:04 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #3
RE: How to change the minimum value in the slider?
(10-19-2011 08:04 PM)Driklyn Wrote:  
Code:
value = Lerp(45, 135, slider());

What do you mean by "but by default 0..135?" Something like this?

Code:
value = Lerp((default ? 0 : 45), 135, slider());

'default' is a bool variable that you set to true when you want 0 and false when you want 45.

Thank you very much
10-19-2011 08:32 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #4
RE: How to change the minimum value in the slider?
Hello,

I have to change minimum value of progress bar, but I want it also to be drawn on the screen and I don't know how to use solution above.
My problem is related to experience in my game. I have three values. The first is experience needed to get next level (maximum value of progress bar), the second is experience needed to get current level of player (minimum value of progress bar) and the third value is curren experience points which player has. When player gets some exp and his current points reached maximum value, progress bar should change it's min and max values to previous max value and new max value which is recalculated points needed to get next level (progress bar is reseted but variables aren't changed). How can I get that without using additional variables?
(This post was last modified: 06-24-2012 08:39 PM by Harry.)
06-24-2012 08:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply