Rotary dial knob control example

Crank Storyboard Designer samples and code snippets.

Moderator: jamiev

Rotary dial knob control example

Postby garry » Mon May 21, 2018 7:59 am

Here is an example of a rotary knob style control similar to that of a volume or mixer control. With this control the inner image is rotated around its' centre axis and in this case the angular position is calculated and displayed. Touch and motion events are tracked and resolved to a rotation angle using trigonometry in Lua script and used to dynamically reposition the image.

It should be simple to replace the images with an alternative design as needed however be careful to set the alignment properties of the images to be horizontal centre-vertical centre, Rotaion-'Rotate around centre of control' otherwise the image is rendered incorrectly on movement.

The artwork itself was generated using and imported from Photoshop.

This is a complete Storyboard project saved as an archive file. To import this to your workspace select File->Import->Projects from Folder or Archive->Archive then browse to the zip file , open and import the Eclipse project.

Garry
Attachments
RotaryKnob_example.zip
Example of a rotary knob style control
(206.72 KiB) Downloaded 89 times
garry
 
Posts: 6
Joined: Wed Jan 31, 2018 5:22 am
Location: Bath, UK

Return to Samples

Who is online

Users browsing this forum: No registered users and 1 guest

cron