layerSceneComponent.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import type { Scene } from "../scene";
  2. import type { ISceneComponent } from "../sceneComponent";
  3. import type { Layer } from "./layer";
  4. import type { AbstractScene } from "../abstractScene";
  5. declare module "../abstractScene" {
  6. interface AbstractScene {
  7. /**
  8. * The list of layers (background and foreground) of the scene
  9. */
  10. layers: Array<Layer>;
  11. }
  12. }
  13. /**
  14. * Defines the layer scene component responsible to manage any layers
  15. * in a given scene.
  16. */
  17. export declare class LayerSceneComponent implements ISceneComponent {
  18. /**
  19. * The component name helpful to identify the component in the list of scene components.
  20. */
  21. readonly name = "Layer";
  22. /**
  23. * The scene the component belongs to.
  24. */
  25. scene: Scene;
  26. private _engine;
  27. /**
  28. * Creates a new instance of the component for the given scene
  29. * @param scene Defines the scene to register the component in
  30. */
  31. constructor(scene?: Scene);
  32. /**
  33. * Registers the component in a given scene
  34. */
  35. register(): void;
  36. /**
  37. * Rebuilds the elements related to this component in case of
  38. * context lost for instance.
  39. */
  40. rebuild(): void;
  41. /**
  42. * Disposes the component and the associated resources.
  43. */
  44. dispose(): void;
  45. private _draw;
  46. private _drawCameraPredicate;
  47. private _drawCameraBackground;
  48. private _drawCameraForegroundWithPostProcessing;
  49. private _drawCameraForegroundWithoutPostProcessing;
  50. private _drawRenderTargetPredicate;
  51. private _drawRenderTargetBackground;
  52. private _drawRenderTargetForegroundWithPostProcessing;
  53. private _drawRenderTargetForegroundWithoutPostProcessing;
  54. /**
  55. * Adds all the elements from the container to the scene
  56. * @param container the container holding the elements
  57. */
  58. addFromContainer(container: AbstractScene): void;
  59. /**
  60. * Removes all the elements in the container from the scene
  61. * @param container contains the elements to remove
  62. * @param dispose if the removed element should be disposed (default: false)
  63. */
  64. removeFromContainer(container: AbstractScene, dispose?: boolean): void;
  65. }