babylonjs-gui 7.5.0 → 7.6.1

Sign up to get free protection for your applications and to get access to all the features.
package/babylon.gui.d.ts CHANGED
@@ -432,8 +432,9 @@ declare module BABYLON.GUI {
432
432
  * Recreate the content of the ADT from a JSON object
433
433
  * @param serializedObject define the JSON serialized object to restore from
434
434
  * @param scaleToSize defines whether to scale to texture to the saved size
435
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
435
436
  */
436
- parseSerializedObject(serializedObject: any, scaleToSize?: boolean): void;
437
+ parseSerializedObject(serializedObject: any, scaleToSize?: boolean, urlRewriter?: (url: string) => string): void;
437
438
  /**
438
439
  * Clones the ADT. If no mesh is defined, the GUI will be considered as a fullscreen GUI
439
440
  * @param newName defines the name of the new ADT
@@ -445,39 +446,44 @@ declare module BABYLON.GUI {
445
446
  * Recreate the content of the ADT from a JSON object
446
447
  * @param serializedObject define the JSON serialized object to restore from
447
448
  * @param scaleToSize defines whether to scale to texture to the saved size
449
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
448
450
  * @deprecated Please use parseSerializedObject instead
449
451
  */
450
- parseContent: (serializedObject: any, scaleToSize?: boolean) => void;
452
+ parseContent: (serializedObject: any, scaleToSize?: boolean, urlRewriter?: ((url: string) => string) | undefined) => void;
451
453
  /**
452
454
  * Recreate the content of the ADT from a snippet saved by the GUI editor
453
455
  * @param snippetId defines the snippet to load
454
456
  * @param scaleToSize defines whether to scale to texture to the saved size
455
457
  * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
458
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
456
459
  * @returns a promise that will resolve on success
457
460
  */
458
- static ParseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture): Promise<AdvancedDynamicTexture>;
461
+ static ParseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
459
462
  /**
460
463
  * Recreate the content of the ADT from a snippet saved by the GUI editor
461
464
  * @param snippetId defines the snippet to load
462
465
  * @param scaleToSize defines whether to scale to texture to the saved size
466
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
463
467
  * @returns a promise that will resolve on success
464
468
  */
465
- parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<AdvancedDynamicTexture>;
469
+ parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
466
470
  /**
467
471
  * Recreate the content of the ADT from a url json
468
472
  * @param url defines the url to load
469
473
  * @param scaleToSize defines whether to scale to texture to the saved size
470
474
  * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.
475
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
471
476
  * @returns a promise that will resolve on success
472
477
  */
473
- static ParseFromFileAsync(url: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture): Promise<AdvancedDynamicTexture>;
478
+ static ParseFromFileAsync(url: string, scaleToSize?: boolean, appendToAdt?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
474
479
  /**
475
480
  * Recreate the content of the ADT from a url json
476
481
  * @param url defines the url to load
477
482
  * @param scaleToSize defines whether to scale to texture to the saved size
483
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
478
484
  * @returns a promise that will resolve on success
479
485
  */
480
- parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<AdvancedDynamicTexture>;
486
+ parseFromURLAsync(url: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture>;
481
487
  private static _LoadURLContentAsync;
482
488
  /**
483
489
  * Compares two rectangle based controls for pixel overlap
@@ -954,7 +960,7 @@ declare module BABYLON.GUI {
954
960
  /**
955
961
  * @internal
956
962
  */
957
- _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
963
+ _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): void;
958
964
  isReady(): boolean;
959
965
  }
960
966
 
@@ -1057,6 +1063,8 @@ declare module BABYLON.GUI {
1057
1063
  private _gradient;
1058
1064
  /** @internal */
1059
1065
  protected _rebuildLayout: boolean;
1066
+ /** @internal */
1067
+ protected _urlRewriter?: (url: string) => string;
1060
1068
  /**
1061
1069
  * BABYLON.Observable that fires when the control's enabled state changes
1062
1070
  */
@@ -1763,9 +1771,10 @@ declare module BABYLON.GUI {
1763
1771
  * Parses a serialized object into this control
1764
1772
  * @param serializedObject the object with the serialized properties
1765
1773
  * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
1774
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
1766
1775
  * @returns this control
1767
1776
  */
1768
- parse(serializedObject: any, host?: AdvancedDynamicTexture): Control;
1777
+ parse(serializedObject: any, host?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control;
1769
1778
  /**
1770
1779
  * Serializes the current control
1771
1780
  * @param serializationObject defined the JSON serialized object
@@ -1776,7 +1785,7 @@ declare module BABYLON.GUI {
1776
1785
  /**
1777
1786
  * @internal
1778
1787
  */
1779
- _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
1788
+ _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): void;
1780
1789
  /** Releases associated resources */
1781
1790
  dispose(): void;
1782
1791
  private static _HORIZONTAL_ALIGNMENT_LEFT;
@@ -1801,7 +1810,7 @@ declare module BABYLON.GUI {
1801
1810
  /**
1802
1811
  * @internal
1803
1812
  */
1804
- static _GetFontOffset(font: string): {
1813
+ static _GetFontOffset(font: string, engineToUse?: BABYLON.AbstractEngine): {
1805
1814
  ascent: number;
1806
1815
  height: number;
1807
1816
  descent: number;
@@ -1810,9 +1819,10 @@ declare module BABYLON.GUI {
1810
1819
  * Creates a Control from parsed data
1811
1820
  * @param serializedObject defines parsed data
1812
1821
  * @param host defines the hosting AdvancedDynamicTexture
1822
+ * @param urlRewriter defines an url rewriter to update urls before sending them to the controls
1813
1823
  * @returns a new Control
1814
1824
  */
1815
- static Parse(serializedObject: any, host: AdvancedDynamicTexture): Control;
1825
+ static Parse(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control;
1816
1826
  static AddHeader: (control: Control, text: string, size: string | number, options: {
1817
1827
  isHorizontal: boolean;
1818
1828
  controlFirst: boolean;