@netless/slide 0.2.3 → 0.2.7
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/lib/PlayerController.js +22 -10
- package/lib/Slide.d.ts +0 -2
- package/lib/Slide.js +1 -1
- package/package.json +2 -2
package/lib/PlayerController.js
CHANGED
|
@@ -17,7 +17,8 @@ var PlayerController = /** @class */ (function () {
|
|
|
17
17
|
var _this = this;
|
|
18
18
|
this.stateId = setInterval(function () {
|
|
19
19
|
if (_this.player.view) {
|
|
20
|
-
_this.controller.runTimeFps.setValue(_this.player.
|
|
20
|
+
_this.controller.runTimeFps.setValue(_this.player.fps.value);
|
|
21
|
+
_this.controller.drawCall.setValue(_this.player.runtime.drawCall);
|
|
21
22
|
_this.controller.runTimeResolution.setValue(_this.player.view.width + "*" + _this.player.view.height);
|
|
22
23
|
}
|
|
23
24
|
}, 500);
|
|
@@ -30,21 +31,28 @@ var PlayerController = /** @class */ (function () {
|
|
|
30
31
|
});
|
|
31
32
|
gui.domElement.style.opacity = ".6";
|
|
32
33
|
gui.domElement.style.transformOrigin = "100% 0";
|
|
33
|
-
gui.domElement.style.transform = "scale(1
|
|
34
|
+
gui.domElement.style.transform = "scale(1)";
|
|
34
35
|
this.target.appendChild(gui.domElement);
|
|
35
36
|
gui.domElement.style.position = "absolute";
|
|
36
37
|
gui.domElement.style.right = "0";
|
|
37
38
|
gui.domElement.style.top = "0";
|
|
38
39
|
gui.domElement.style.zIndex = "2";
|
|
40
|
+
var runTimeFps = gui.add({ "FPS": 0 }, "FPS", 0);
|
|
41
|
+
var drawCall = gui.add({ "drawCall": 0 }, "drawCall", 0);
|
|
42
|
+
var runTimeResolution = gui.add({ "分辨率": "" }, "分辨率", "");
|
|
43
|
+
var moreCalculation = gui.add({ "额外计算": 0 }, "额外计算", 0, 200);
|
|
44
|
+
var renderOptions = gui.addFolder("renderOptions");
|
|
39
45
|
this.controller = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
runTimeResolution: runTimeResolution,
|
|
47
|
+
runTimeFps: runTimeFps,
|
|
48
|
+
drawCall: drawCall,
|
|
49
|
+
moreCalculation: moreCalculation,
|
|
50
|
+
minFPS: renderOptions.add({ "最低fps": (_a = this.data.minFPS) !== null && _a !== void 0 ? _a : 40 }, "最低fps", 0, 60),
|
|
51
|
+
maxFPS: renderOptions.add({ "最高fps": (_b = this.data.maxFPS) !== null && _b !== void 0 ? _b : 50 }, "最高fps", 0, 60),
|
|
52
|
+
resolution: renderOptions.add({ "目标分辨倍率": (_c = this.data.resolution) !== null && _c !== void 0 ? _c : window.devicePixelRatio }, "目标分辨倍率", 0.5, 6),
|
|
53
|
+
autoResolution: renderOptions.add({ "自动分辨率": (_d = this.data.autoResolution) !== null && _d !== void 0 ? _d : false }, "自动分辨率", true),
|
|
54
|
+
autoFps: renderOptions.add({ "自动fps": (_e = this.data.autoFPS) !== null && _e !== void 0 ? _e : true }, "自动fps", true),
|
|
55
|
+
transactionBgColor: renderOptions.addColor({ "切页背景色": this.data.transactionBgColor }, "切页背景色"),
|
|
48
56
|
};
|
|
49
57
|
this.controller.runTimeFps.disabled = true;
|
|
50
58
|
this.controller.runTimeResolution.disabled = true;
|
|
@@ -72,6 +80,10 @@ var PlayerController = /** @class */ (function () {
|
|
|
72
80
|
_this.data.resolution = value;
|
|
73
81
|
_this.player.updateConfig(_this.data);
|
|
74
82
|
});
|
|
83
|
+
this.controller.transactionBgColor.onChange(function (value) {
|
|
84
|
+
_this.data.transactionBgColor = value;
|
|
85
|
+
_this.player.updateConfig(_this.data);
|
|
86
|
+
});
|
|
75
87
|
var md5Value;
|
|
76
88
|
this.controller.moreCalculation.onChange(function (value) {
|
|
77
89
|
var calc = function () {
|
package/lib/Slide.d.ts
CHANGED
|
@@ -29,8 +29,6 @@ export interface ISlideRenderOptions {
|
|
|
29
29
|
maxFPS?: number;
|
|
30
30
|
/** 渲染分辨倍率, 整数, 默认为 window.devicePixelRatio */
|
|
31
31
|
resolution?: number;
|
|
32
|
-
/** 最小分辨倍率, 默认为 1 */
|
|
33
|
-
minResolution?: number;
|
|
34
32
|
/** 是否根据 fps, 自动调整分辨率, 默认为 false */
|
|
35
33
|
autoResolution?: boolean;
|
|
36
34
|
/** 是否自动降低渲染 fps */
|