Volume Knob

I made a volume knob using the following rules:

3 self attributes (integer) startRotation, startAngle, newAngle.

Rule when touch is pressed:

-change attribute startRotation to self.rotation

-change attribute startAngle to vectorToAngle(mouse.position.x-self.position.x,mouse.position.y-self.position.y)

-constrain attribute newAngle to vectorToAngle(mouse.position.x-self.position.x,mouse.position.y-self.position.y)

-constrain attribute selfRotation to startRotation+(newAngle-startAngle)

I would like to limit the volume knob to a min & max rotation. As right now it can spin all the way around. How could I limit the min & max rotation of the volume knob?

Comments

  • master200012master200012 Member Posts: 372
    edited July 2013
    Just made a post about this as a question, take a look. :D
    Hope it helps!

    Called: "Using min and max in one Constrain?"
Sign In or Register to comment.