Increase/decrease slider
SingleSparq
Member Posts: 1,339
Hi - I have a slider that moves on touch right or left. How can I get it to increase (moving right) or decrease (moving left) an integer attribute with a limit on the plus or minus (say middle was 100 can go max +100 and -100 in left right when moved. Any help is appreciated!
Comments
If you were only going up to 100 in increments of 10 you would need 10 actors to get to the plus 100 and worry about the decrease (going up would increase with each overlap so you would have to make 10 booleans to switch them to "on", then add some timer cause you can't be overlapping for more than a certain time or it will switch to false etc. etc.
Will keep trying it though.
http://gamesalad.com/game/play/30207
How does one mark this resolved?
--Yodapollo
In that example, I have it clamping down to 0 and 1 with Rules, something like: When The musicVolume < 0 change musicvolume to 0, and when musicvolume is > 1 change musicvolume to 1. You will need to delete those two rules if you want a larger range.
And you can get rid of the 'floor', you don't need it. Unless you want to strip off the decimal.
So, for example, if you want the range to be [-100,100] change the formula to look like this:
((( self.Position.X - self.leftLimit )/( self.rightLimit - self.leftLimit ))*200)-100
Hope this helps!
Joe