loadingScreen.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * Interface used to present a loading screen while loading a scene
  3. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
  4. */
  5. export interface ILoadingScreen {
  6. /**
  7. * Function called to display the loading screen
  8. */
  9. displayLoadingUI: () => void;
  10. /**
  11. * Function called to hide the loading screen
  12. */
  13. hideLoadingUI: () => void;
  14. /**
  15. * Gets or sets the color to use for the background
  16. */
  17. loadingUIBackgroundColor: string;
  18. /**
  19. * Gets or sets the text to display while loading
  20. */
  21. loadingUIText: string;
  22. }
  23. /**
  24. * Class used for the default loading screen
  25. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
  26. */
  27. export declare class DefaultLoadingScreen implements ILoadingScreen {
  28. private _renderingCanvas;
  29. private _loadingText;
  30. private _loadingDivBackgroundColor;
  31. private _loadingDiv;
  32. private _loadingTextDiv;
  33. private _style;
  34. /** Gets or sets the logo url to use for the default loading screen */
  35. static DefaultLogoUrl: string;
  36. /** Gets or sets the spinner url to use for the default loading screen */
  37. static DefaultSpinnerUrl: string;
  38. /**
  39. * Creates a new default loading screen
  40. * @param _renderingCanvas defines the canvas used to render the scene
  41. * @param _loadingText defines the default text to display
  42. * @param _loadingDivBackgroundColor defines the default background color
  43. */
  44. constructor(_renderingCanvas: HTMLCanvasElement, _loadingText?: string, _loadingDivBackgroundColor?: string);
  45. /**
  46. * Function called to display the loading screen
  47. */
  48. displayLoadingUI(): void;
  49. /**
  50. * Function called to hide the loading screen
  51. */
  52. hideLoadingUI(): void;
  53. /**
  54. * Gets or sets the text to display while loading
  55. */
  56. set loadingUIText(text: string);
  57. get loadingUIText(): string;
  58. /**
  59. * Gets or sets the color to use for the background
  60. */
  61. get loadingUIBackgroundColor(): string;
  62. set loadingUIBackgroundColor(color: string);
  63. private _resizeLoadingUI;
  64. }