vsTASKER 7 User Manual
×
Menu
Index

Knob

 
A Knob if a continuous device that the user can rotate using the mouse, between two values.
It is represented by a rotating texture above an optional background texture.
 
 
On the HMI grid, add a Knob:
or
 
Give it a name, then open the property window.
 
Select Visual Aspect then load the following texture:
\Data\HMI\Electrical\volume_knob.gif
 
Unckeck AutoSize in order to resize the knob to make it fit into the HMI panel.
 
Now, in Minimum, set the value that will be attached to the minimal angle.
We set value [-10..10] for angles [0..180]
 
In the Runtime panel, let's add this code:
printf("Knob value = %f\n", get());
 
Then compile and run:
 
 
 
The Knob Sprite does not have a background.
It must be added manually (this might change in future versions).
 
Add now a simple texture (TexShape)
Load the following texture:
\Data\HMI\Electrical\volume_knob_back.gif
 
Resize and position it over the knob texture:
then move it backward:
 
You can resize it to finely adjust the knob size and position it using the keyboard arrow keys.
To automatically align (if the textures have been correctly centered), you can select both objects (select one, then the second with the Shift key down), then right click: