properties_gui.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /// <reference path="../../dist/preview release/gui/babylon.gui.d.ts"/>
  2. module INSPECTOR {
  3. /**
  4. * Function that add gui objects properties to the variable PROPERTIES
  5. */
  6. export function loadGUIProperties(){
  7. let PROPERTIES_GUI = {
  8. 'ValueAndUnit': {
  9. type: BABYLON.GUI.ValueAndUnit,
  10. properties: ['_value', 'unit'],
  11. format: (valueAndUnit: BABYLON.GUI.ValueAndUnit) =>
  12. { return valueAndUnit }
  13. },
  14. 'Control': {
  15. type: BABYLON.GUI.Control,
  16. properties: [
  17. '_alpha',
  18. '_fontFamily',
  19. '_color',
  20. '_scaleX',
  21. '_scaleY',
  22. '_rotation',
  23. '_currentMeasure',
  24. '_width',
  25. '_height',
  26. '_left',
  27. '_top',
  28. '_linkedMesh',
  29. 'isHitTestVisible',
  30. 'isPointerBlocker',
  31. ],
  32. format: (control: BABYLON.GUI.Control) => { return control.name }
  33. },
  34. 'Button': {
  35. type: BABYLON.GUI.Button,
  36. properties: new Array(),
  37. format: (button: BABYLON.GUI.Button) => { return button.name }
  38. },
  39. 'ColorPicker': {
  40. type: BABYLON.GUI.ColorPicker,
  41. properties: ['_value'],
  42. format: (colorPicker: BABYLON.GUI.ColorPicker) => { return colorPicker.name }
  43. },
  44. 'Checkbox': {
  45. type: BABYLON.GUI.Checkbox,
  46. properties: ['_isChecked', '_background'],
  47. format: (checkbox: BABYLON.GUI.Checkbox) => { return checkbox.name }
  48. },
  49. 'Ellipse': {
  50. type: BABYLON.GUI.Ellipse,
  51. properties: ['_thickness'],
  52. format: (ellipse: BABYLON.GUI.Ellipse) => { return ellipse.name }
  53. },
  54. 'Image': {
  55. type: BABYLON.GUI.Image,
  56. properties: [
  57. '_imageWidth',
  58. '_imageHeight',
  59. '_loaded',
  60. '_source',
  61. ],
  62. format: (image: BABYLON.GUI.Image) => { return image.name }
  63. },
  64. 'Line': {
  65. type: BABYLON.GUI.Line,
  66. properties: ['_lineWidth',
  67. '_background',
  68. '_x1',
  69. '_y1',
  70. '_x2',
  71. '_y2',
  72. ],
  73. format: (line: BABYLON.GUI.Line) => { return line.name }
  74. },
  75. 'RadioButton': {
  76. type: BABYLON.GUI.RadioButton,
  77. properties: ['_isChecked', '_background'],
  78. format: (radioButton: BABYLON.GUI.RadioButton) => { return radioButton.name }
  79. },
  80. 'Rectangle': {
  81. type: BABYLON.GUI.Rectangle,
  82. properties: ['_thickness', '_cornerRadius'],
  83. format: (rectangle: BABYLON.GUI.Rectangle) => { return rectangle.name }
  84. },
  85. 'Slider': {
  86. type: BABYLON.GUI.Slider,
  87. properties: [
  88. '_minimum',
  89. '_maximum',
  90. '_value',
  91. '_background',
  92. '_borderColor',
  93. ],
  94. format: (slider: BABYLON.GUI.Slider) => { return slider.name }
  95. },
  96. 'StackPanel': {
  97. type: BABYLON.GUI.StackPanel,
  98. properties: ['_isVertical'],
  99. format: (stackPanel: BABYLON.GUI.StackPanel) => { return stackPanel.name }
  100. },
  101. 'TextBlock': {
  102. type: BABYLON.GUI.TextBlock,
  103. properties: ['_text', '_textWrapping'],
  104. format: (textBlock: BABYLON.GUI.TextBlock) => { return textBlock.name }
  105. },
  106. 'Container': {
  107. type: BABYLON.GUI.Container,
  108. properties: ['_background'],
  109. format: (container: BABYLON.GUI.Container) => { return container.name }
  110. },
  111. }
  112. for (let prop in PROPERTIES_GUI) {
  113. (<any>PROPERTIES)[prop] = (<any>PROPERTIES_GUI)[prop];
  114. }
  115. }
  116. }