tracker.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /// <reference path="../../dist/preview release/babylon.d.ts"/>
  2. module BABYLON.GUI {
  3. export class Tracker {
  4. private _x: ValueAndUnit;
  5. private _y: ValueAndUnit;
  6. private _control: Nullable<Control>;
  7. private _mesh: Nullable<BABYLON.AbstractMesh>;
  8. _point: BABYLON.Vector2;
  9. constructor(x: number = 0, y: number = 0, public unit = ValueAndUnit.UNITMODE_PIXEL, public negativeValueAllowed = true, control: Nullable<Control> = null, mesh: Nullable<BABYLON.AbstractMesh> = null) {
  10. this._x = new ValueAndUnit(x);
  11. this._y = new ValueAndUnit(y);
  12. this._control = control;
  13. this._mesh = mesh;
  14. this._point = new BABYLON.Vector2(0, 0);
  15. }
  16. get x(): ValueAndUnit {
  17. return this._x;
  18. }
  19. get y(): ValueAndUnit {
  20. return this._y;
  21. }
  22. get control(): Nullable<Control> {
  23. return this._control;
  24. }
  25. set control(value: Nullable<Control>) {
  26. this._control = value;
  27. }
  28. get mesh(): Nullable<BABYLON.AbstractMesh> {
  29. return this._mesh;
  30. }
  31. set mesh(value: Nullable<BABYLON.AbstractMesh>) {
  32. this._mesh = value;
  33. }
  34. }
  35. }