You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-1
Original file line number
Diff line number
Diff line change
@@ -52,8 +52,98 @@ You can advance them and they are guarantied to always stay in bounds.
52
52
And they have a percentage-field that you may query, or even set and then query the value-field since the two of them are always kept in sync.
53
53
54
54
```C#
55
-
Faderf=newFader(0f, 500f);
55
+
Faderf=newFader(0f, 100f){value=10};
56
+
Assert.AreEqual(f.Value, 10, EPSILON);
57
+
Assert.AreEqual(f.Percentage, 10, EPSILON);
58
+
```
59
+
60
+
It can do the following:
61
+
62
+
* If you swap min and max in the constructor, those are switched back.
63
+
* If you set the value outside the interval, the value is capped (constrained to the interval) automatically.
64
+
* You can set or get the value using the Value property or the Percentage property. Those two correspond. Setting one corrects the other.
65
+
* The boundaries are mutable after construction of the fader.
66
+
* If you happen to cut your value while making the interval smaller, then the value (and the percentage) are corrected to point to the outer limits of the interval automatically.
67
+
* You can invert the fader by setting the IsInverted property and reverse the direction while still adding values... Imagine you want to lerp from 0 to 50 and back to 0 again. You can now add 1 every update and add an if that will invert the fader if value > 50. Viola.
68
+
69
+
###### ValueChangedEvent
56
70
71
+
You may register a ValueChangedEvent to get notified if the value of that fader changes.
0 commit comments