浏览代码

ScreenshotTools. Move interface IScreenshotSize into self directory

> https://forum.babylonjs.com/t/define-typescript-interface-for-options-of-method-to-make-screenshots/4713
> https://github.com/BabylonJS/Babylon.js/pull/6630
Dok11 6 年之前
父节点
当前提交
16bed842ef
共有 3 个文件被更改,包括 19 次插入24 次删除
  1. 17 0
      src/Misc/interfaces/screenshotSize.ts
  2. 1 23
      src/Misc/screenshotTools.ts
  3. 1 1
      src/Misc/tools.ts

+ 17 - 0
src/Misc/interfaces/screenshotSize.ts

@@ -0,0 +1,17 @@
+export interface IScreenshotSize {
+  /**
+   * number in pixels for canvas height
+   */
+  height?: number;
+
+  /**
+   * multiplier allowing render at a higher or lower resolution
+   * If value is defined then height and width will be ignored and taken from camera
+   */
+  precision?: number;
+
+  /**
+   * number in pixels for canvas width
+   */
+  width?: number;
+}

+ 1 - 23
src/Misc/screenshotTools.ts

@@ -7,33 +7,11 @@ import { Constants } from "../Engines/constants";
 import { Logger } from "./logger";
 import { Logger } from "./logger";
 import { _TypeStore } from "./typeStore";
 import { _TypeStore } from "./typeStore";
 import { Tools } from "./tools";
 import { Tools } from "./tools";
+import { IScreenshotSize } from './interfaces/screenshotSize';
 
 
 declare type Engine = import("../Engines/engine").Engine;
 declare type Engine = import("../Engines/engine").Engine;
 
 
 /**
 /**
- * This interface describe parameter that can be set to an object
- *
- * with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
- */
-export interface IScreenshotSize {
-    /**
-     * number in pixels for canvas height
-     */
-    height?: number;
-
-    /**
-     * multiplier allowing render at a higher or lower resolution
-     * If value is defined then height and width will be ignored and taken from camera
-     */
-    precision?: number;
-
-    /**
-     * number in pixels for canvas width
-     */
-    width?: number;
-}
-
-/**
  * Class containing a set of static utilities functions for screenshots
  * Class containing a set of static utilities functions for screenshots
  */
  */
 export class ScreenshotTools {
 export class ScreenshotTools {

+ 1 - 1
src/Misc/tools.ts

@@ -15,7 +15,7 @@ import { PromisePolyfill } from './promise';
 import { TimingTools } from './timingTools';
 import { TimingTools } from './timingTools';
 import { InstantiationTools } from './instantiationTools';
 import { InstantiationTools } from './instantiationTools';
 import { GUID } from './guid';
 import { GUID } from './guid';
-import { IScreenshotSize } from './screenshotTools';
+import { IScreenshotSize } from './interfaces/screenshotSize';
 
 
 declare type Camera = import("../Cameras/camera").Camera;
 declare type Camera = import("../Cameras/camera").Camera;
 declare type Engine = import("../Engines/engine").Engine;
 declare type Engine = import("../Engines/engine").Engine;