nuklear
nuklear copied to clipboard
Element Rotation and Knob Widget
The rotation of objects should be allowed to create more complex layouts. The first example that comes to mind is a 2d charts where the headers are clickable buttons tilted at a 45 degree angle. Pie charts and dials could also be easily built from rotated components. Another case of rotation is rotary knobs. Just adding rotation should allow most of these more complex widgets to easily be built...
No, there is no support for rotation and I'm also not sure whether there should be one as supporting rotation essentially means implementing support for (all) affine transformations, which might unnecessarily complicate API.
Nuklear though makes it easy to implement your own variant of the current widget which could among other things support rotation in the desired way.
I'm open though to any API proposals and implementations as I think it might actually be useful.
@dumblob I'll have to go back over the API before I propose the syntax. BUt here is a quick overview of how I'd expect a knob to work:
- Most knobs are drag started Left or Down for Counterclockwise and Up or Right for Clockwise.
- Knobs should have the following attributes:
- Start Angle (Required)
- End Angle (If null implies continuous rotation)
- Rotation Value (Initial value of rotation or 0 if null)
- Detent Steps (number of detents in the knob or null for continuous)
- Radius Size (How big the knob is...)
I believe this would satisfy all cases including Continuous Knobs, Partial Rotation, Detented Potentiometers, Needle Meters (180deg)...