Welcome Guest (Log in)

RotationControl (CircularSlider)

StarStarStarStarStar
Custom control (15) | Image (10) | Slider (5) | Angle (2) |
General
Expander triangle
  • Author
  • Rating
  • Type
  • Revision
  • Downloaded
  • Updated
  • Hermann Hoch
  • StarStarStarStarStar
  • Stack
  • 5
  • 496 Times
  • 07 July 2017
RotationControl (CircularSlider)
## Version 2.0.2 ... Jul 07, 2017 ... uploaded correct version from disk
## Version 2.0.1 ... Jul 07, 2017 ... adjusted display to show only positive values
## Version 2.0.0 ... Jul 07, 2017 ... added "ByAngle"-method variants
## Version 1.0.1 ... Jul 05, 2017 ... removed a typo (doesn't change the result)
## Version 1.0.0 ... Jul 05, 2017 ... first public version / "ToAngle"-mathod

RotationControl is a behavior button that shows on mouseDown an circular slider control:
Attach the button as behavior to any LC object that has an angle property.
Click anywhere on the target, a bit away from it's location and drag the mouse at about along a circle around the location of the target.
Then select one of two methods for the result of the dragging:
* TO ANGLE: gets the angle of the mouseloc relative to the loc of the target and sets the angle of the target accordingly.
* BY ANGLE: gets the angle of the mouseloc relative to the loc of the target (with the angle of the clickloc as baseAngle) and sets the angle of the target additive to the current angle of the target. Variant "diff" displays the difference to the current angel, variant "full" displays the resulting angle.

For method "ToAngle" imagine a clock with a very long hour hand around the loc of the target object.
Then click far from that clock at the hand at ...
... 12 o'clock to have a value around 0 degrees,
... 3 o'clock to have a value around 90 degrees,
... 6 o'clock to have a value around 180 degrees,
... 9 o'clock to have a value around 270 degrees.

How to use in your stack:
1. Copy the group "OvalSlider" to your stack, it contains the invisible button "RotationControlBehavior".
3. Set the behavior of the LC object (that has an angle property) to the long id of that button.

You may also set the layout of the group "Ovalslider" by script (basics are in the button).

Use it with LC 6/7/8/9 on Mac/Win/linux or with LC 6/7 on RaspberryPi.
Ajax Loader
Tags
Expander triangle
User Comments
Expander triangle