babylon.worldSpaceCanvas2dNode.js 1.0 KB

123456789101112131415161718192021222324252627
  1. var __extends = (this && this.__extends) || function (d, b) {
  2. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3. function __() { this.constructor = d; }
  4. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5. };
  6. var BABYLON;
  7. (function (BABYLON) {
  8. /**
  9. * This is the class that is used to display a World Space Canvas into a 3D scene
  10. */
  11. var WorldSpaceCanvas2DNode = (function (_super) {
  12. __extends(WorldSpaceCanvas2DNode, _super);
  13. function WorldSpaceCanvas2DNode(name, scene, canvas) {
  14. _super.call(this, name, scene);
  15. this._canvas = canvas;
  16. }
  17. WorldSpaceCanvas2DNode.prototype.dispose = function () {
  18. _super.prototype.dispose.call(this);
  19. if (this._canvas) {
  20. this._canvas.dispose();
  21. this._canvas = null;
  22. }
  23. };
  24. return WorldSpaceCanvas2DNode;
  25. }(BABYLON.Mesh));
  26. BABYLON.WorldSpaceCanvas2DNode = WorldSpaceCanvas2DNode;
  27. })(BABYLON || (BABYLON = {}));