Pārlūkot izejas kodu

ScreenshotTools. New interface IScreenshotSize for argument the size

> https://forum.babylonjs.com/t/define-typescript-interface-for-options-of-method-to-make-screenshots/4713
Dok11 6 gadi atpakaļ
vecāks
revīzija
56a8302235
1 mainītis faili ar 23 papildinājumiem un 0 dzēšanām
  1. 23 0
      src/Misc/tools.ts

+ 23 - 0
src/Misc/tools.ts

@@ -27,6 +27,29 @@ interface IColor4Like {
 }
 
 /**
+ * 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
  */
 export class Tools {