File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ Bangle.js Dial Display Library
2+ ======================
3+
4+
5+ > Take a look at README.md for hints on developing with this library.
6+
7+ Usage
8+ -----
9+
10+ ``` JS
11+ var DialDisplay = require (" Dial_Display" );
12+ var dialDisplay = new DialDisplay (options);
13+ ```
14+
15+ For example in use with the Dial module:
16+
17+ ``` JS
18+ var options = {
19+ stepsPerWholeTurn : 6 ,
20+ dialRect : {
21+ x: 0 ,
22+ y: 0 ,
23+ w: g .getWidth ()/ 2 ,
24+ h: g .getHeight ()/ 2 ,
25+ }
26+ }
27+
28+ var DialDisplay = require (" Dial_Display" );
29+ var dialDisplay = new DialDisplay (options);
30+
31+ var cb = (step )=> {
32+ var value = dialDisplay (step);
33+ };
34+
35+ var Dial = require (" Dial" );
36+ var dial = new Dial (cb, options)
37+ Bangle .on (" drag" , dial);
38+ ```
39+
40+ ` options ` (first argument) (optional) is an object containing:
41+
42+ ` stepsPerWholeTurn ` - how many steps there are in one complete turn of the dial.
43+ ` dialRect ` - decides the area of the screen the dial is set up on.
44+
45+ Defaults:
46+ ``` js
47+ { stepsPerWholeTurn : 7
48+ dialRect : {
49+ x: 0 ,
50+ y: 0 ,
51+ w: g .getWidth (),
52+ h: g .getHeight (),
53+ },
54+ }
55+ ```
56+
You can’t perform that action at this time.
0 commit comments