Quellcode durchsuchen

3dModeling pulic.js 李欣儒 commit at 2021-03-12

李欣儒 vor 4 Jahren
Ursprung
Commit
be598478a7
1 geänderte Dateien mit 61 neuen und 0 gelöschten Zeilen
  1. 61 0
      3dModeling/tjby20/pulic.js

+ 61 - 0
3dModeling/tjby20/pulic.js

@@ -85,3 +85,64 @@ function exitFps() {
  * 说明:开启小地图
  */
 function createMiniMap() {
+    if (miniMapCtrl == null) {
+        // 添加小地图控件
+        miniMapCtrl = app.addControl(new THING.MiniMapControl({
+            width: 200,
+            height: 200,
+            position: THING.CornerType.LeftBottom,
+            opacity: 0.8,
+            scale: 1,
+            angle: 0,
+            mousewheel: true,
+            cameraViewImg: 'http://www.thingjs.com/static/images/minimap1.png',
+            cameraCenterImg: 'http://www.thingjs.com/static/images/minimap0.png'
+        }));
+        $('.minimap').css('border', '1px solid rgba(255, 255, 255, 0.8)');
+        $('.minimap').css('left', '3px');
+        $('.minimap').css('bottom', '3px');
+    } else {
+        destoryMiniMap();
+        createMiniMap();
+    }
+}
+/**
+ * 说明:关闭小地图
+ */
+function destoryMiniMap() {
+    if (miniMapCtrl != null) {
+        app.removeControl(miniMapCtrl);
+        miniMapCtrl = null;
+    }
+}
+/**
+ * 说明:全屏显示
+ */
+function fullScreen() {
+    let el = document.documentElement;
+    let rfs = el.requestFullScreen || el.webkitRequestFullScreen;
+    if (typeof rfs != "undefined" && rfs) {
+        rfs.call(el);
+    } else if (typeof window.ActiveXObject != "undefined") {
+        let wscript = new ActiveXObject("WScript.Shell");
+        if (wscript != null) {
+            wscript.SendKeys("{F11}");
+        }
+    }
+}
+/**
+ * 说明:退出全屏
+ */
+function exitFullScreen() {
+    let el = document;
+    let cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.exitFullScreen;
+    if (typeof cfs != "undefined" && cfs) {
+        cfs.call(el);
+    } else if (typeof window.ActiveXObject != "undefined") {
+        let wscript = new ActiveXObject("WScript.Shell");
+        if (wscript != null) {
+            wscript.SendKeys("{F11}");
+        }
+    }
+}
+/**