Graphical dial control...
BlitzMax Forums/BlitzMax Programming/Graphical dial control...
| ||
I'm going to write a simple Dial control for use in the GAF framework but how would you expect it to work.. MouseDown and move would... 1. turn the dial to follow the mouse pointer. 2. changes in mouse Y value turn the dial up or down. I would think it's the first then you can just click the position you want and the dial turns to that position? |
| ||
1. |
| ||
Fruity loops makes extensive use of (2) and it feels quite natural. |
| ||
Most audio software uses 2 and it works pretty well. |
| ||
What about both? The first click sets the position, then the mouse down to fine tune it ;) |
| ||
My RadioBaH app has a dial that you can either click and drag or use the mouse-wheel. |
| ||
Does the drag adjust the angle or the value? |
| ||
The angle is the value / the value is the angle. The drag itself adjusts the value, which you then apply to the angle when you draw it. In my case, a volume dial uses this : Local angle:Double = 30.0 + 300.0 * volume cairo.MoveTo(27 - Sin(angle) * 13.5, 60.5 + Cos(angle) * 13.5) cairo.LineTo(27 - Sin(angle) * 16, 60.5 + Cos(angle) * 16) There volume is a value between 0 and 1. The dial can move between 30 and 300 degrees (rather than a full circle). Dragging or scrolling affects the "volume" value. The volume changes as per X and/or Y drag of the mouse. If MouseX < lastX Or MouseY > lastY Then ChangeVolume(-1) ElseIf MouseX > lastX Or MouseY < lastY Then ChangeVolume(1) End If Nothing too complex. :-) |
| ||
Good old RadioBah... one of my favourite apps. Always wondered exactly how you did the volume control. |