lyb-js 1.6.21 → 1.6.22
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/Misc/LibJsHorizontal.d.ts +4 -0
- package/Misc/LibJsHorizontal.js +15 -0
- package/README.md +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @description 用于游戏判断是否为横版状态
|
|
2
|
+
* @param mode h-纯横版游戏 v-纯竖版
|
|
3
|
+
*/
|
|
4
|
+
export const libJsHorizontal = (mode) => {
|
|
5
|
+
const w = window.innerWidth;
|
|
6
|
+
const h = window.innerHeight;
|
|
7
|
+
let isH = w > h;
|
|
8
|
+
if (mode === "h") {
|
|
9
|
+
isH = true;
|
|
10
|
+
}
|
|
11
|
+
else if (mode === "v") {
|
|
12
|
+
isH = false;
|
|
13
|
+
}
|
|
14
|
+
return isH;
|
|
15
|
+
};
|
package/README.md
CHANGED
|
@@ -155,6 +155,8 @@ console.log(t); //"string"
|
|
|
155
155
|
|
|
156
156
|
\- [LibJsClassObservable-类属性监听器](#LibJsClassObservable-类属性监听器)
|
|
157
157
|
|
|
158
|
+
\- [LibJsHorizontal-游戏横版状态](#LibJsHorizontal-游戏横版状态)
|
|
159
|
+
|
|
158
160
|
|
|
159
161
|
### Random-随机
|
|
160
162
|
|
|
@@ -680,6 +682,10 @@ setTimeout(()=>{
|
|
|
680
682
|
}, 1000)
|
|
681
683
|
```
|
|
682
684
|
|
|
685
|
+
### LibJsHorizontal-游戏横版状态
|
|
686
|
+
|
|
687
|
+
> 需要传递当前游戏的适配模式
|
|
688
|
+
|
|
683
689
|
## Random-随机
|
|
684
690
|
|
|
685
691
|
### LibJsProbabilityResult-概率触发
|