tosijs-3d 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -6
- package/changelog/v0.11.2.md +23 -0
- package/dist/gamepad-art.d.ts +1 -3
- package/dist/gamepad-art.d.ts.map +1 -1
- package/dist/gamepad-art.js +2 -4
- package/dist/gamepad-art.js.map +1 -1
- package/dist/glass-gamepad.d.ts +46 -4
- package/dist/glass-gamepad.d.ts.map +1 -1
- package/dist/glass-gamepad.js +222 -54
- package/dist/glass-gamepad.js.map +1 -1
- package/dist/hardware-gamepad.d.ts.map +1 -1
- package/dist/hardware-gamepad.js +4 -2
- package/dist/hardware-gamepad.js.map +1 -1
- package/dist/tosi-b3d.d.ts +16 -0
- package/dist/tosi-b3d.d.ts.map +1 -1
- package/dist/tosi-b3d.js +108 -22
- package/dist/tosi-b3d.js.map +1 -1
- package/dist/touch-gamepad.d.ts.map +1 -1
- package/dist/touch-gamepad.js +5 -1
- package/dist/touch-gamepad.js.map +1 -1
- package/dist/virtual-gamepad.d.ts +4 -0
- package/dist/virtual-gamepad.d.ts.map +1 -1
- package/dist/virtual-gamepad.js +10 -1
- package/dist/virtual-gamepad.js.map +1 -1
- package/dist/xr-gamepad.d.ts.map +1 -1
- package/dist/xr-gamepad.js +3 -3
- package/dist/xr-gamepad.js.map +1 -1
- package/package.json +1 -1
- package/static/attributes.json +19 -1
- package/static/attributes.txt +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,17 +14,18 @@ Upgrading across a minor? Start with [Migration](/Migration/).
|
|
|
14
14
|
|
|
15
15
|
Nothing yet.
|
|
16
16
|
|
|
17
|
-
## 0.11.
|
|
17
|
+
## 0.11.2
|
|
18
18
|
|
|
19
|
-
The latest release.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
The latest release. A new glass gamepad, laid out like a pair of VR
|
|
20
|
+
controllers held flat, with stick clicks (L3, R3) that a hardware pad and a
|
|
21
|
+
headset's thumbsticks now report too; view and menu on the headset's system bar
|
|
22
|
+
when a scene asks for them; and the full-screen button on an iPhone.
|
|
23
|
+
[Read 0.11.2](/v0.11.2/).
|
|
24
24
|
|
|
25
25
|
## Every version
|
|
26
26
|
|
|
27
27
|
<!-- toc -->
|
|
28
|
+
- [0.11.2](/v0.11.2/)
|
|
28
29
|
- [0.11.1](/v0.11.1/)
|
|
29
30
|
- [0.11.0](/v0.11.0/)
|
|
30
31
|
- [0.10.20](/v0.10.20/)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 0.11.2
|
|
2
|
+
|
|
3
|
+
<!--{ "parent": "CHANGELOG", "order": 9988998 }-->
|
|
4
|
+
|
|
5
|
+
## Added
|
|
6
|
+
|
|
7
|
+
- **A new glass gamepad**, laid out like a pair of VR controllers held flat: on each side a trigger, bumper, stick and two face buttons (X and Y on the left, A and B on the right, in Xbox colours), with view and menu between them at the bottom. It is one SVG sheet (`static/glass-gamepad.svg`) that the pad cuts into three clusters along the bottom; on a narrow screen the centre cluster tucks in between the others when it fits and sits above them when it does not.
|
|
8
|
+
- **Stick clicks (L3, R3)**: `leftStickPress` and `rightStickPress` on `VirtualGamepad`. The glass pad has a button under each stick, a hardware pad's buttons 10 and 11 feed them, and so does clicking a thumbstick in a headset. On the biped, a left-stick click sneaks (as L3 does in GTA V).
|
|
9
|
+
- **View and menu on the headset's system bar**, when the glass pad's `controls` name them. `pad.pulse('view' | 'menu')` presses one from code.
|
|
10
|
+
|
|
11
|
+
## Changed
|
|
12
|
+
|
|
13
|
+
- **The glass gamepad hides its d-pad unless you name it** (`controls="…,dpad"`). View and menu are still shown by default, but will become opt-in in a future release: name them if you use them.
|
|
14
|
+
- **In a headset, clicking a thumbstick is a stick press**, not view (right) or menu (left). Y still toggles the camera view, and the system bar carries view and menu when a scene asks for them.
|
|
15
|
+
- **A hardware pad's view and menu buttons (8 and 9) now reach `view` and `menu`**; they were read but dropped.
|
|
16
|
+
- The glass pad's `clusters.top` is now `clusters.center` (`top` still works).
|
|
17
|
+
|
|
18
|
+
## Fixed
|
|
19
|
+
|
|
20
|
+
- **The full-screen button on an iPhone.** iPhone Safari has no Fullscreen API for anything but video, so the button hid itself. It now maximises the scene instead: in the top layer as a popover (iOS 17+, so a doc page's card cannot trap it), filling what is visible.
|
|
21
|
+
- **The glass gamepad demo goes full screen with its pad**, which is now inside the scene as `gamepad: true` mounts it; beside the scene it was left behind.
|
|
22
|
+
|
|
23
|
+
Size: barrel (min, packages external) 1244.9 KB raw / 425.9 KB gz, +0.27% on 0.11.1.
|
package/dist/gamepad-art.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const gamepadRightSvg = "<svg x=\"779.85px\" y=\"292px\" width=\"323.15px\" height=\"520.88px\" viewBox=\"779.85 292.0 323.15 520.88\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path id=\"right_bumper\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M1076.06,409.445 C1054.6,392.735,1027.78,383.094,999.346,383.094 C999.346,383.094,898.025,383.094,898.025,383.094 C898.025,383.094,898.025,415.094,898.025,415.094 C898.025,415.094,999.346,415.094,999.346,415.094 C1020.74,415.084,1040.94,422.442,1057,435.163 C1057,435.163,1076.06,409.445,1076.06,409.445 z\"/>\n <path id=\"right_stick_travel\" style=\"fill:#505050;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;\" d=\"M889.726,634.081 C927.787,634.081,958.641,664.935,958.641,702.995 C958.641,741.055,927.787,771.909,889.726,771.909 C851.666,771.909,820.812,741.055,820.812,702.995 C820.812,664.935,851.666,634.081,889.726,634.081 z\"/>\n <path id=\"right_stick\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M889.726,670.031 C907.932,670.031,922.69,684.789,922.69,702.995 C922.69,721.201,907.932,735.959,889.726,735.959 C871.52,735.959,856.762,721.201,856.762,702.995 C856.762,684.789,871.52,670.031,889.726,670.031 z\"/>\n <path id=\"A\" style=\"fill:#ff1c24;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M991.607,567.71 C1009.81,567.71,1024.57,582.468,1024.57,600.674 C1024.57,618.88,1009.81,633.638,991.607,633.638 C973.401,633.638,958.642,618.88,958.642,600.674 C958.642,582.468,973.401,567.71,991.607,567.71 z\"/>\n <path id=\"Y\" style=\"fill:#3da8f4;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M991.607,446.475 C1009.81,446.475,1024.57,461.234,1024.57,479.439 C1024.57,497.645,1009.81,512.404,991.607,512.404 C973.401,512.404,958.642,497.645,958.642,479.439 C958.642,461.234,973.401,446.475,991.607,446.475 z\"/>\n <path id=\"X\" style=\"fill:#8cc63f;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M963.954,540.057 C963.954,558.262,949.195,573.021,930.989,573.021 C912.784,573.021,898.025,558.262,898.025,540.057 C898.025,521.851,912.784,507.092,930.989,507.092 C949.195,507.092,963.954,521.851,963.954,540.057 z\"/>\n <path id=\"B\" style=\"fill:#fbed21;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M1085.19,540.057 C1085.19,558.262,1070.43,573.021,1052.22,573.021 C1034.02,573.021,1019.26,558.262,1019.26,540.057 C1019.26,521.851,1034.02,507.092,1052.22,507.092 C1070.43,507.092,1085.19,521.851,1085.19,540.057 z\"/>\n <path id=\"right_trigger\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M1052.75,373.281 C1052.75,373.281,1052.75,321.375,1052.75,321.375 C1052.75,315.62,1047.57,311.252,1041.9,312.227 C1026.91,314.802,1016.95,319.056,989.296,319.056 C962.502,319.056,951.685,314.802,936.697,312.227 C931.025,311.252,925.843,315.62,925.843,321.375 C925.843,321.375,925.843,363.094,925.843,363.094 C925.843,363.094,1003.35,363.094,1003.35,363.094 C1020.7,363.094,1037.45,366.685,1052.75,373.281 z\"/>\n </g>\n</svg>";
|
|
3
|
-
export declare const gamepadTopSvg = "<svg x=\"399pt\" y=\"35pt\" width=\"200pt\" height=\"80pt\" viewBox=\"399 35 200 80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path id=\"menu\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M530.562,94.775 C525.141,94.775,520.747,90.381,520.747,84.961 C520.747,84.961,520.747,65.04,520.747,65.04 C520.747,59.619,525.141,55.225,530.562,55.225 C530.562,55.225,567.817,55.225,567.817,55.225 C576.512,55.225,583.56,62.274,583.56,70.969 C583.56,70.969,583.56,79.032,583.56,79.032 C583.56,87.727,576.512,94.775,567.817,94.775 C567.817,94.775,530.562,94.775,530.562,94.775 z\"/>\n <path id=\"view\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M467.439,55.225 C472.859,55.225,477.253,59.619,477.253,65.04 C477.253,65.04,477.253,84.961,477.253,84.961 C477.253,90.381,472.859,94.775,467.439,94.775 C467.439,94.775,430.184,94.775,430.184,94.775 C421.489,94.775,414.44,87.727,414.44,79.032 C414.44,79.032,414.44,70.969,414.44,70.969 C414.44,62.274,421.489,55.225,430.184,55.225 C430.184,55.225,467.439,55.225,467.439,55.225 z\"/>\n </g>\n</svg>";
|
|
1
|
+
export declare const glassGamepadSvg = "<svg x=\"0px\" y=\"0px\" width=\"1024px\" height=\"420px\" viewBox=\"0 0 1024 420\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path id=\"menu\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M534,410 C528.477,410,524,405.556,524,400.074 C524,400.074,524,379.926,524,379.926 C524,374.444,528.477,370,534,370 C534,370,571.959,370,571.959,370 C580.818,370,588,377.129,588,385.923 C588,385.923,588,394.078,588,394.078 C588,402.871,580.818,410,571.959,410 C571.959,410,534,410,534,410 z\"/>\n <path id=\"view\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M490,370 C495.523,370,500,374.444,500,379.926 C500,379.926,500,400.074,500,400.074 C500,405.556,495.523,410,490,410 C490,410,452.041,410,452.041,410 C443.182,410,436,402.871,436,394.078 C436,394.078,436,385.923,436,385.923 C436,377.129,443.182,370,452.041,370 C452.041,370,490,370,490,370 z\"/>\n <path id=\"left_stick_click\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M159.773,370 C166.526,370,172,375.434,172,382.137 C172,382.137,172,397.863,172,397.863 C172,404.566,166.526,410,159.773,410 C159.773,410,120.227,410,120.227,410 C113.474,410,108,404.566,108,397.863 C108,397.863,108,382.137,108,382.137 C108,375.434,113.474,370,120.227,370 C120.227,370,159.773,370,159.773,370 z\"/>\n <path id=\"right_stick_click\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M899.773,370 C906.526,370,912,375.434,912,382.137 C912,382.137,912,397.863,912,397.863 C912,404.566,906.526,410,899.773,410 C899.773,410,860.227,410,860.227,410 C853.474,410,848,404.566,848,397.863 C848,397.863,848,382.137,848,382.137 C848,375.434,853.474,370,860.227,370 C860.227,370,899.773,370,899.773,370 z\"/>\n <path id=\"dpad_up\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M492,179.195 C492,173.672,496.444,169.195,501.926,169.195 C501.926,169.195,522.074,169.195,522.074,169.195 C527.556,169.195,532,173.672,532,179.195 C532,179.195,532,217.154,532,217.154 C532,226.013,524.871,233.195,516.077,233.195 C516.077,233.195,507.922,233.195,507.922,233.195 C499.129,233.195,492,226.013,492,217.154 C492,217.154,492,179.195,492,179.195 z\"/>\n <path id=\"dpad_down\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M532,333.195 C532,338.718,527.556,343.195,522.074,343.195 C522.074,343.195,501.926,343.195,501.926,343.195 C496.444,343.195,492,338.718,492,333.195 C492,333.195,492,295.236,492,295.236 C492,286.377,499.129,279.195,507.923,279.195 C507.923,279.195,516.078,279.195,516.078,279.195 C524.871,279.195,532,286.377,532,295.236 C532,295.236,532,333.195,532,333.195 z\"/>\n <path id=\"dpad_right\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M589.428,236.663 C594.848,236.663,599.242,241.057,599.242,246.477 C599.242,246.477,599.242,266.398,599.242,266.398 C599.242,271.818,594.848,276.212,589.428,276.212 C589.428,276.212,552.173,276.212,552.173,276.212 C543.478,276.212,536.43,269.164,536.43,260.469 C536.43,260.469,536.43,252.406,536.43,252.406 C536.43,243.711,543.478,236.663,552.173,236.663 C552.173,236.663,589.428,236.663,589.428,236.663 z\"/>\n <path id=\"dpad_left\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M435,276.195 C429.477,276.195,425,271.751,425,266.269 C425,266.269,425,246.121,425,246.121 C425,240.639,429.477,236.195,435,236.195 C435,236.195,472.959,236.195,472.959,236.195 C481.818,236.195,489,243.324,489,252.118 C489,252.118,489,260.272,489,260.272 C489,269.066,481.818,276.195,472.959,276.195 C472.959,276.195,435,276.195,435,276.195 z\"/>\n <path id=\"left_stick_travel\" style=\"fill:#9e9e9e;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;\" d=\"M140,186.195 C178.66,186.195,210,217.535,210,256.195 C210,294.855,178.66,326.195,140,326.195 C101.34,326.195,70,294.855,70,256.195 C70,217.535,101.34,186.195,140,186.195 z\"/>\n <path id=\"left_stick\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M140,224 C157.673,224,172,238.327,172,256 C172,273.673,157.673,288,140,288 C122.327,288,108,273.673,108,256 C108,238.327,122.327,224,140,224 z\"/>\n <path id=\"right_stick_travel\" style=\"fill:#9e9e9e;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;\" d=\"M880,186 C918.66,186,950,217.34,950,256 C950,294.66,918.66,326,880,326 C841.34,326,810,294.66,810,256 C810,217.34,841.34,186,880,186 z\"/>\n <path id=\"right_stick\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M880,224 C897.673,224,912,238.327,912,256 C912,273.673,897.673,288,880,288 C862.327,288,848,273.673,848,256 C848,238.327,862.327,224,880,224 z\"/>\n <path id=\"A\" style=\"fill:#8cc63f;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M724,310 C741.673,310,756,324.327,756,342 C756,359.673,741.673,374,724,374 C706.327,374,692,359.673,692,342 C692,324.327,706.327,310,724,310 z\"/>\n <path id=\"X\" style=\"fill:#3da8f4;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M332,342 C332,359.673,317.673,374,300,374 C282.327,374,268,359.673,268,342 C268,324.327,282.327,310,300,310 C317.673,310,332,324.327,332,342 z\"/>\n <path id=\"Y\" style=\"fill:#fbed21;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M333,220 C350.673,220,365,234.327,365,252 C365,269.673,350.673,284,333,284 C315.327,284,301,269.673,301,252 C301,234.327,315.327,220,333,220 z\"/>\n <path id=\"B\" style=\"fill:#ff1c24;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M722,252 C722,269.673,707.673,284,690,284 C672.327,284,658,269.673,658,252 C658,234.327,672.327,220,690,220 C707.673,220,722,234.327,722,252 z\"/>\n <path id=\"left_bumper\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M60,112 C60,105.373,65.3726,100,72,100 C72,100,208,100,208,100 C214.627,100,220,105.373,220,112 C220,112,220,132,220,132 C220,138.627,214.627,144,208,144 C208,144,72,144,72,144 C65.3726,144,60,138.627,60,132 C60,132,60,112,60,112 z\"/>\n <path id=\"left_trigger\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M60.0041,26.6505 C60.0041,19.4295,66.5378,13.9484,73.6882,15.1712 C92.5839,18.4027,105.143,23.7402,140.002,23.7402 C173.783,23.7402,187.42,18.4027,206.316,15.1713 C213.466,13.9484,220,19.4295,220,26.6505 C220,26.6505,220,67,220,67 C220,73.6274,214.627,79,208,79 C208,79,72.0009,79,72.0009,79 C65.3732,79,60.0004,73.6268,60.0009,66.9991 C60.0009,66.9991,60.0041,26.6505,60.0041,26.6505 z\"/>\n <path id=\"right_bumper\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M800,112 C800,105.373,805.373,100,812,100 C812,100,948,100,948,100 C954.627,100,960,105.373,960,112 C960,112,960,132,960,132 C960,138.627,954.627,144,948,144 C948,144,812,144,812,144 C805.373,144,800,138.627,800,132 C800,132,800,112,800,112 z\"/>\n <path id=\"right_trigger\" style=\"fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;\" d=\"M800.004,26.6505 C800.004,19.4295,806.538,13.9484,813.688,15.1712 C832.584,18.4027,845.143,23.7402,880.002,23.7402 C913.783,23.7402,927.42,18.4027,946.316,15.1713 C953.466,13.9484,960,19.4295,960,26.6505 C960,26.6505,960,67,960,67 C960,73.6274,954.627,79,948,79 C948,79,812.001,79,812.001,79 C805.373,79,800,73.6268,800.001,66.9991 C800.001,66.9991,800.004,26.6505,800.004,26.6505 z\"/>\n </g>\n</svg>";
|
|
4
2
|
//# sourceMappingURL=gamepad-art.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gamepad-art.d.ts","sourceRoot":"","sources":["../src/gamepad-art.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"gamepad-art.d.ts","sourceRoot":"","sources":["../src/gamepad-art.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,+pSAC0/R,CAAA"}
|
package/dist/gamepad-art.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// GENERATED by bin/dial-art.ts from static/
|
|
2
|
-
export const
|
|
3
|
-
export const gamepadRightSvg = '<svg x="779.85px" y="292px" width="323.15px" height="520.88px" viewBox="779.85 292.0 323.15 520.88" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path id="right_bumper" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M1076.06,409.445 C1054.6,392.735,1027.78,383.094,999.346,383.094 C999.346,383.094,898.025,383.094,898.025,383.094 C898.025,383.094,898.025,415.094,898.025,415.094 C898.025,415.094,999.346,415.094,999.346,415.094 C1020.74,415.084,1040.94,422.442,1057,435.163 C1057,435.163,1076.06,409.445,1076.06,409.445 z"/>\n <path id="right_stick_travel" style="fill:#505050;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;" d="M889.726,634.081 C927.787,634.081,958.641,664.935,958.641,702.995 C958.641,741.055,927.787,771.909,889.726,771.909 C851.666,771.909,820.812,741.055,820.812,702.995 C820.812,664.935,851.666,634.081,889.726,634.081 z"/>\n <path id="right_stick" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M889.726,670.031 C907.932,670.031,922.69,684.789,922.69,702.995 C922.69,721.201,907.932,735.959,889.726,735.959 C871.52,735.959,856.762,721.201,856.762,702.995 C856.762,684.789,871.52,670.031,889.726,670.031 z"/>\n <path id="A" style="fill:#ff1c24;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M991.607,567.71 C1009.81,567.71,1024.57,582.468,1024.57,600.674 C1024.57,618.88,1009.81,633.638,991.607,633.638 C973.401,633.638,958.642,618.88,958.642,600.674 C958.642,582.468,973.401,567.71,991.607,567.71 z"/>\n <path id="Y" style="fill:#3da8f4;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M991.607,446.475 C1009.81,446.475,1024.57,461.234,1024.57,479.439 C1024.57,497.645,1009.81,512.404,991.607,512.404 C973.401,512.404,958.642,497.645,958.642,479.439 C958.642,461.234,973.401,446.475,991.607,446.475 z"/>\n <path id="X" style="fill:#8cc63f;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M963.954,540.057 C963.954,558.262,949.195,573.021,930.989,573.021 C912.784,573.021,898.025,558.262,898.025,540.057 C898.025,521.851,912.784,507.092,930.989,507.092 C949.195,507.092,963.954,521.851,963.954,540.057 z"/>\n <path id="B" style="fill:#fbed21;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M1085.19,540.057 C1085.19,558.262,1070.43,573.021,1052.22,573.021 C1034.02,573.021,1019.26,558.262,1019.26,540.057 C1019.26,521.851,1034.02,507.092,1052.22,507.092 C1070.43,507.092,1085.19,521.851,1085.19,540.057 z"/>\n <path id="right_trigger" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M1052.75,373.281 C1052.75,373.281,1052.75,321.375,1052.75,321.375 C1052.75,315.62,1047.57,311.252,1041.9,312.227 C1026.91,314.802,1016.95,319.056,989.296,319.056 C962.502,319.056,951.685,314.802,936.697,312.227 C931.025,311.252,925.843,315.62,925.843,321.375 C925.843,321.375,925.843,363.094,925.843,363.094 C925.843,363.094,1003.35,363.094,1003.35,363.094 C1020.7,363.094,1037.45,366.685,1052.75,373.281 z"/>\n </g>\n</svg>';
|
|
4
|
-
export const gamepadTopSvg = '<svg x="399pt" y="35pt" width="200pt" height="80pt" viewBox="399 35 200 80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path id="menu" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M530.562,94.775 C525.141,94.775,520.747,90.381,520.747,84.961 C520.747,84.961,520.747,65.04,520.747,65.04 C520.747,59.619,525.141,55.225,530.562,55.225 C530.562,55.225,567.817,55.225,567.817,55.225 C576.512,55.225,583.56,62.274,583.56,70.969 C583.56,70.969,583.56,79.032,583.56,79.032 C583.56,87.727,576.512,94.775,567.817,94.775 C567.817,94.775,530.562,94.775,530.562,94.775 z"/>\n <path id="view" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M467.439,55.225 C472.859,55.225,477.253,59.619,477.253,65.04 C477.253,65.04,477.253,84.961,477.253,84.961 C477.253,90.381,472.859,94.775,467.439,94.775 C467.439,94.775,430.184,94.775,430.184,94.775 C421.489,94.775,414.44,87.727,414.44,79.032 C414.44,79.032,414.44,70.969,414.44,70.969 C414.44,62.274,421.489,55.225,430.184,55.225 C430.184,55.225,467.439,55.225,467.439,55.225 z"/>\n </g>\n</svg>';
|
|
1
|
+
// GENERATED by bin/dial-art.ts from static/glass-gamepad.svg. Do not edit: edit the SVGs and run `bun run dial-art`.
|
|
2
|
+
export const glassGamepadSvg = '<svg x="0px" y="0px" width="1024px" height="420px" viewBox="0 0 1024 420" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path id="menu" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M534,410 C528.477,410,524,405.556,524,400.074 C524,400.074,524,379.926,524,379.926 C524,374.444,528.477,370,534,370 C534,370,571.959,370,571.959,370 C580.818,370,588,377.129,588,385.923 C588,385.923,588,394.078,588,394.078 C588,402.871,580.818,410,571.959,410 C571.959,410,534,410,534,410 z"/>\n <path id="view" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M490,370 C495.523,370,500,374.444,500,379.926 C500,379.926,500,400.074,500,400.074 C500,405.556,495.523,410,490,410 C490,410,452.041,410,452.041,410 C443.182,410,436,402.871,436,394.078 C436,394.078,436,385.923,436,385.923 C436,377.129,443.182,370,452.041,370 C452.041,370,490,370,490,370 z"/>\n <path id="left_stick_click" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M159.773,370 C166.526,370,172,375.434,172,382.137 C172,382.137,172,397.863,172,397.863 C172,404.566,166.526,410,159.773,410 C159.773,410,120.227,410,120.227,410 C113.474,410,108,404.566,108,397.863 C108,397.863,108,382.137,108,382.137 C108,375.434,113.474,370,120.227,370 C120.227,370,159.773,370,159.773,370 z"/>\n <path id="right_stick_click" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M899.773,370 C906.526,370,912,375.434,912,382.137 C912,382.137,912,397.863,912,397.863 C912,404.566,906.526,410,899.773,410 C899.773,410,860.227,410,860.227,410 C853.474,410,848,404.566,848,397.863 C848,397.863,848,382.137,848,382.137 C848,375.434,853.474,370,860.227,370 C860.227,370,899.773,370,899.773,370 z"/>\n <path id="dpad_up" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M492,179.195 C492,173.672,496.444,169.195,501.926,169.195 C501.926,169.195,522.074,169.195,522.074,169.195 C527.556,169.195,532,173.672,532,179.195 C532,179.195,532,217.154,532,217.154 C532,226.013,524.871,233.195,516.077,233.195 C516.077,233.195,507.922,233.195,507.922,233.195 C499.129,233.195,492,226.013,492,217.154 C492,217.154,492,179.195,492,179.195 z"/>\n <path id="dpad_down" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M532,333.195 C532,338.718,527.556,343.195,522.074,343.195 C522.074,343.195,501.926,343.195,501.926,343.195 C496.444,343.195,492,338.718,492,333.195 C492,333.195,492,295.236,492,295.236 C492,286.377,499.129,279.195,507.923,279.195 C507.923,279.195,516.078,279.195,516.078,279.195 C524.871,279.195,532,286.377,532,295.236 C532,295.236,532,333.195,532,333.195 z"/>\n <path id="dpad_right" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M589.428,236.663 C594.848,236.663,599.242,241.057,599.242,246.477 C599.242,246.477,599.242,266.398,599.242,266.398 C599.242,271.818,594.848,276.212,589.428,276.212 C589.428,276.212,552.173,276.212,552.173,276.212 C543.478,276.212,536.43,269.164,536.43,260.469 C536.43,260.469,536.43,252.406,536.43,252.406 C536.43,243.711,543.478,236.663,552.173,236.663 C552.173,236.663,589.428,236.663,589.428,236.663 z"/>\n <path id="dpad_left" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M435,276.195 C429.477,276.195,425,271.751,425,266.269 C425,266.269,425,246.121,425,246.121 C425,240.639,429.477,236.195,435,236.195 C435,236.195,472.959,236.195,472.959,236.195 C481.818,236.195,489,243.324,489,252.118 C489,252.118,489,260.272,489,260.272 C489,269.066,481.818,276.195,472.959,276.195 C472.959,276.195,435,276.195,435,276.195 z"/>\n <path id="left_stick_travel" style="fill:#9e9e9e;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;" d="M140,186.195 C178.66,186.195,210,217.535,210,256.195 C210,294.855,178.66,326.195,140,326.195 C101.34,326.195,70,294.855,70,256.195 C70,217.535,101.34,186.195,140,186.195 z"/>\n <path id="left_stick" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M140,224 C157.673,224,172,238.327,172,256 C172,273.673,157.673,288,140,288 C122.327,288,108,273.673,108,256 C108,238.327,122.327,224,140,224 z"/>\n <path id="right_stick_travel" style="fill:#9e9e9e;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:none;" d="M880,186 C918.66,186,950,217.34,950,256 C950,294.66,918.66,326,880,326 C841.34,326,810,294.66,810,256 C810,217.34,841.34,186,880,186 z"/>\n <path id="right_stick" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M880,224 C897.673,224,912,238.327,912,256 C912,273.673,897.673,288,880,288 C862.327,288,848,273.673,848,256 C848,238.327,862.327,224,880,224 z"/>\n <path id="A" style="fill:#8cc63f;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M724,310 C741.673,310,756,324.327,756,342 C756,359.673,741.673,374,724,374 C706.327,374,692,359.673,692,342 C692,324.327,706.327,310,724,310 z"/>\n <path id="X" style="fill:#3da8f4;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M332,342 C332,359.673,317.673,374,300,374 C282.327,374,268,359.673,268,342 C268,324.327,282.327,310,300,310 C317.673,310,332,324.327,332,342 z"/>\n <path id="Y" style="fill:#fbed21;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M333,220 C350.673,220,365,234.327,365,252 C365,269.673,350.673,284,333,284 C315.327,284,301,269.673,301,252 C301,234.327,315.327,220,333,220 z"/>\n <path id="B" style="fill:#ff1c24;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M722,252 C722,269.673,707.673,284,690,284 C672.327,284,658,269.673,658,252 C658,234.327,672.327,220,690,220 C707.673,220,722,234.327,722,252 z"/>\n <path id="left_bumper" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M60,112 C60,105.373,65.3726,100,72,100 C72,100,208,100,208,100 C214.627,100,220,105.373,220,112 C220,112,220,132,220,132 C220,138.627,214.627,144,208,144 C208,144,72,144,72,144 C65.3726,144,60,138.627,60,132 C60,132,60,112,60,112 z"/>\n <path id="left_trigger" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M60.0041,26.6505 C60.0041,19.4295,66.5378,13.9484,73.6882,15.1712 C92.5839,18.4027,105.143,23.7402,140.002,23.7402 C173.783,23.7402,187.42,18.4027,206.316,15.1713 C213.466,13.9484,220,19.4295,220,26.6505 C220,26.6505,220,67,220,67 C220,73.6274,214.627,79,208,79 C208,79,72.0009,79,72.0009,79 C65.3732,79,60.0004,73.6268,60.0009,66.9991 C60.0009,66.9991,60.0041,26.6505,60.0041,26.6505 z"/>\n <path id="right_bumper" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M800,112 C800,105.373,805.373,100,812,100 C812,100,948,100,948,100 C954.627,100,960,105.373,960,112 C960,112,960,132,960,132 C960,138.627,954.627,144,948,144 C948,144,812,144,812,144 C805.373,144,800,138.627,800,132 C800,132,800,112,800,112 z"/>\n <path id="right_trigger" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;opacity:1;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-width:16;" d="M800.004,26.6505 C800.004,19.4295,806.538,13.9484,813.688,15.1712 C832.584,18.4027,845.143,23.7402,880.002,23.7402 C913.783,23.7402,927.42,18.4027,946.316,15.1713 C953.466,13.9484,960,19.4295,960,26.6505 C960,26.6505,960,67,960,67 C960,73.6274,954.627,79,948,79 C948,79,812.001,79,812.001,79 C805.373,79,800,73.6268,800.001,66.9991 C800.001,66.9991,800.004,26.6505,800.004,26.6505 z"/>\n </g>\n</svg>';
|
|
5
3
|
//# sourceMappingURL=gamepad-art.js.map
|
package/dist/gamepad-art.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gamepad-art.js","sourceRoot":"","sources":["../src/gamepad-art.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"gamepad-art.js","sourceRoot":"","sources":["../src/gamepad-art.ts"],"names":[],"mappings":"AAAA,qHAAqH;AAErH,MAAM,CAAC,MAAM,eAAe,GAC1B,ohSAAohS,CAAA"}
|
package/dist/glass-gamepad.d.ts
CHANGED
|
@@ -2,14 +2,41 @@ import { Component } from 'tosijs';
|
|
|
2
2
|
import { type GamepadSource, type VirtualGamepad } from './virtual-gamepad.js';
|
|
3
3
|
export type ClusterAnchor = 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-left' | 'top-right' | 'top-center';
|
|
4
4
|
export type ClusterConfig = {
|
|
5
|
-
/** SVG to load for this cluster.
|
|
5
|
+
/** SVG to load for this cluster. The default is the built-in sheet, cut to
|
|
6
|
+
* this cluster's parts; any other url is shown whole. */
|
|
6
7
|
url?: string;
|
|
7
8
|
/** Which corner to pin it to. */
|
|
8
9
|
anchor?: ClusterAnchor;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
10
|
+
/** Width of the cluster overlay in cqmin — relative to the host's own size,
|
|
11
|
+
* so it scales with the view/card (multiplied by `scale`). The default sizes
|
|
12
|
+
* every cluster cut from the sheet at one scale. */
|
|
11
13
|
vmin?: number;
|
|
12
14
|
};
|
|
15
|
+
export type ClusterKey = 'left' | 'right' | 'center';
|
|
16
|
+
/** Every control the pad shows when none are named: all but the d-pad. */
|
|
17
|
+
export declare const DEFAULT_CONTROLS: string[];
|
|
18
|
+
export type Box = {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The viewBox that shows a cluster cut from the sheet: its parts' boxes, grown
|
|
26
|
+
* by `pad` (half the widest stroke), and every stick's full REACH — the travel
|
|
27
|
+
* circle's radius plus the knob's, around the travel's centre — so a thumb
|
|
28
|
+
* dragged to the rim is never clipped by the cluster's edge.
|
|
29
|
+
*/
|
|
30
|
+
export declare function cropBox(parts: Box[], pad: number, sticks?: {
|
|
31
|
+
travel: Box;
|
|
32
|
+
knob: Box;
|
|
33
|
+
}[]): Box;
|
|
34
|
+
/**
|
|
35
|
+
* The box around a path's points, read from its `d` (absolute coordinates, as
|
|
36
|
+
* the art is exported). A curve lies inside its control points, so this can
|
|
37
|
+
* only be a little generous, never short.
|
|
38
|
+
*/
|
|
39
|
+
export declare function pathBox(d: string): Box | null;
|
|
13
40
|
/**
|
|
14
41
|
* Parse a gamepad spec — e.g. `"a,b,right_stick(40,0),menu"` — into the controls
|
|
15
42
|
* to show and any per-piece offsets. `''` / `'true'` → all controls. `a/b/x/y`
|
|
@@ -54,10 +81,13 @@ export declare class B3dGamepad extends Component implements GamepadSource {
|
|
|
54
81
|
idleSeconds: number;
|
|
55
82
|
fade: 'on' | 'off';
|
|
56
83
|
fadedOpacity: number;
|
|
57
|
-
/** Advanced: per-cluster url/anchor/vmin overrides, or `false` to omit one.
|
|
84
|
+
/** Advanced: per-cluster url/anchor/vmin overrides, or `false` to omit one.
|
|
85
|
+
* `top` is the old name of `center`, which sits at the bottom now. */
|
|
58
86
|
clusters?: {
|
|
59
87
|
left?: ClusterConfig | false;
|
|
60
88
|
right?: ClusterConfig | false;
|
|
89
|
+
center?: ClusterConfig | false;
|
|
90
|
+
/** @deprecated use `center` */
|
|
61
91
|
top?: ClusterConfig | false;
|
|
62
92
|
};
|
|
63
93
|
handleButton?: (part: string, pressed: boolean) => void;
|
|
@@ -119,6 +149,18 @@ export declare class B3dGamepad extends Component implements GamepadSource {
|
|
|
119
149
|
private _idleTimer;
|
|
120
150
|
private _faded;
|
|
121
151
|
private _build;
|
|
152
|
+
private _placed;
|
|
153
|
+
private _resize?;
|
|
154
|
+
private _layout;
|
|
155
|
+
/** Did the `controls` spec name this part outright (not the default set)? */
|
|
156
|
+
requested(part: string): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Press a button from somewhere else for a moment: the headset's system bar
|
|
159
|
+
* presses view and menu this way, since the pad itself is not there. Held
|
|
160
|
+
* for `ms`, long enough for every controllable's edge detector to see it.
|
|
161
|
+
*/
|
|
162
|
+
pulse(part: 'view' | 'menu', ms?: number): void;
|
|
163
|
+
private _pulses;
|
|
122
164
|
poll(): VirtualGamepad;
|
|
123
165
|
/** Mirror external gamepad state (hardware/keyboard) onto untouched controls. */
|
|
124
166
|
reflectState(pad: VirtualGamepad): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glass-gamepad.d.ts","sourceRoot":"","sources":["../src/glass-gamepad.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glass-gamepad.d.ts","sourceRoot":"","sources":["../src/glass-gamepad.ts"],"names":[],"mappings":"AAwKA,OAAO,EAAE,SAAS,EAAwB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