babylon.gui.module.d.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. /// <reference types="babylonjs"/>
  2. declare module 'babylonjs-gui' {
  3. export = BABYLON.GUI;
  4. }
  5. declare module BABYLON.GUI {
  6. interface IFocusableControl {
  7. onFocus(): void;
  8. onBlur(): void;
  9. processKeyboard(evt: KeyboardEvent): void;
  10. }
  11. class AdvancedDynamicTexture extends DynamicTexture {
  12. private _isDirty;
  13. private _renderObserver;
  14. private _resizeObserver;
  15. private _preKeyboardObserver;
  16. private _pointerMoveObserver;
  17. private _pointerObserver;
  18. private _canvasPointerOutObserver;
  19. private _background;
  20. _rootContainer: Container;
  21. _lastPickedControl: Control;
  22. _lastControlOver: Control;
  23. _lastControlDown: Control;
  24. _capturingControl: Control;
  25. _shouldBlockPointer: boolean;
  26. _layerToDispose: Layer;
  27. _linkedControls: Control[];
  28. private _isFullscreen;
  29. private _fullscreenViewport;
  30. private _idealWidth;
  31. private _idealHeight;
  32. private _renderAtIdealSize;
  33. private _focusedControl;
  34. private _blockNextFocusCheck;
  35. background: string;
  36. idealWidth: number;
  37. idealHeight: number;
  38. renderAtIdealSize: boolean;
  39. readonly layer: Layer;
  40. readonly rootContainer: Container;
  41. focusedControl: IFocusableControl;
  42. constructor(name: string, width: number, height: number, scene: Scene, generateMipMaps?: boolean, samplingMode?: number);
  43. executeOnAllControls(func: (control: Control) => void, container?: Container): void;
  44. markAsDirty(): void;
  45. addControl(control: Control): AdvancedDynamicTexture;
  46. removeControl(control: Control): AdvancedDynamicTexture;
  47. dispose(): void;
  48. private _onResize();
  49. _getGlobalViewport(scene: Scene): Viewport;
  50. private _checkUpdate(camera);
  51. private _render();
  52. private _doPicking(x, y, type);
  53. attach(): void;
  54. attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
  55. moveFocusToControl(control: IFocusableControl): void;
  56. private _manageFocus();
  57. private _attachToOnPointerOut(scene);
  58. static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
  59. static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Scene): AdvancedDynamicTexture;
  60. }
  61. }
  62. declare module BABYLON.GUI {
  63. class Measure {
  64. left: number;
  65. top: number;
  66. width: number;
  67. height: number;
  68. constructor(left: number, top: number, width: number, height: number);
  69. copyFrom(other: Measure): void;
  70. isEqualsTo(other: Measure): boolean;
  71. static Empty(): Measure;
  72. }
  73. }
  74. declare module BABYLON.GUI {
  75. class Matrix2D {
  76. m: Float32Array;
  77. constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
  78. fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
  79. determinant(): number;
  80. invertToRef(result: Matrix2D): Matrix2D;
  81. multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
  82. transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
  83. static Identity(): Matrix2D;
  84. static TranslationToRef(x: number, y: number, result: Matrix2D): void;
  85. static ScalingToRef(x: number, y: number, result: Matrix2D): void;
  86. static RotationToRef(angle: number, result: Matrix2D): void;
  87. private static _TempPreTranslationMatrix;
  88. private static _TempPostTranslationMatrix;
  89. private static _TempRotationMatrix;
  90. private static _TempScalingMatrix;
  91. private static _TempCompose0;
  92. private static _TempCompose1;
  93. private static _TempCompose2;
  94. static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Matrix2D, result: Matrix2D): void;
  95. }
  96. }
  97. declare module BABYLON.GUI {
  98. class ValueAndUnit {
  99. unit: number;
  100. negativeValueAllowed: boolean;
  101. private _value;
  102. ignoreAdaptiveScaling: boolean;
  103. constructor(value: any, unit?: number, negativeValueAllowed?: boolean);
  104. readonly isPercentage: boolean;
  105. readonly isPixel: boolean;
  106. readonly internalValue: number;
  107. getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
  108. getValue(host: AdvancedDynamicTexture): number;
  109. toString(host: AdvancedDynamicTexture): string;
  110. fromString(source: string | number): boolean;
  111. private static _Regex;
  112. private static _UNITMODE_PERCENTAGE;
  113. private static _UNITMODE_PIXEL;
  114. static readonly UNITMODE_PERCENTAGE: number;
  115. static readonly UNITMODE_PIXEL: number;
  116. }
  117. }
  118. declare module BABYLON.GUI {
  119. class Control {
  120. name: string;
  121. private _alpha;
  122. private _alphaSet;
  123. private _zIndex;
  124. _root: Container;
  125. _host: AdvancedDynamicTexture;
  126. _currentMeasure: Measure;
  127. private _fontFamily;
  128. private _fontStyle;
  129. private _fontSize;
  130. private _font;
  131. _width: ValueAndUnit;
  132. _height: ValueAndUnit;
  133. private _lastMeasuredFont;
  134. protected _fontOffset: {
  135. ascent: number;
  136. height: number;
  137. descent: number;
  138. };
  139. private _color;
  140. protected _horizontalAlignment: number;
  141. protected _verticalAlignment: number;
  142. private _isDirty;
  143. private _cachedParentMeasure;
  144. private _paddingLeft;
  145. private _paddingRight;
  146. private _paddingTop;
  147. private _paddingBottom;
  148. _left: ValueAndUnit;
  149. _top: ValueAndUnit;
  150. private _scaleX;
  151. private _scaleY;
  152. private _rotation;
  153. private _transformCenterX;
  154. private _transformCenterY;
  155. private _transformMatrix;
  156. private _invertTransformMatrix;
  157. private _transformedPosition;
  158. private _isMatrixDirty;
  159. private _cachedOffsetX;
  160. private _cachedOffsetY;
  161. private _isVisible;
  162. _linkedMesh: AbstractMesh;
  163. private _fontSet;
  164. private _dummyVector2;
  165. private _downCount;
  166. private _enterCount;
  167. private _doNotRender;
  168. isHitTestVisible: boolean;
  169. isPointerBlocker: boolean;
  170. isFocusInvisible: boolean;
  171. protected _linkOffsetX: ValueAndUnit;
  172. protected _linkOffsetY: ValueAndUnit;
  173. readonly typeName: string;
  174. /**
  175. * An event triggered when the pointer move over the control.
  176. * @type {BABYLON.Observable}
  177. */
  178. onPointerMoveObservable: Observable<Vector2>;
  179. /**
  180. * An event triggered when the pointer move out of the control.
  181. * @type {BABYLON.Observable}
  182. */
  183. onPointerOutObservable: Observable<Control>;
  184. /**
  185. * An event triggered when the pointer taps the control
  186. * @type {BABYLON.Observable}
  187. */
  188. onPointerDownObservable: Observable<Vector2>;
  189. /**
  190. * An event triggered when pointer up
  191. * @type {BABYLON.Observable}
  192. */
  193. onPointerUpObservable: Observable<Vector2>;
  194. /**
  195. * An event triggered when pointer enters the control
  196. * @type {BABYLON.Observable}
  197. */
  198. onPointerEnterObservable: Observable<Control>;
  199. /**
  200. * An event triggered when the control is marked as dirty
  201. * @type {BABYLON.Observable}
  202. */
  203. onDirtyObservable: Observable<Control>;
  204. alpha: number;
  205. scaleX: number;
  206. scaleY: number;
  207. rotation: number;
  208. transformCenterY: number;
  209. transformCenterX: number;
  210. horizontalAlignment: number;
  211. verticalAlignment: number;
  212. width: string | number;
  213. height: string | number;
  214. fontFamily: string;
  215. fontStyle: string;
  216. fontSize: string | number;
  217. color: string;
  218. zIndex: number;
  219. notRenderable: boolean;
  220. isVisible: boolean;
  221. readonly isDirty: boolean;
  222. paddingLeft: string | number;
  223. paddingRight: string | number;
  224. paddingTop: string | number;
  225. paddingBottom: string | number;
  226. left: string | number;
  227. top: string | number;
  228. linkOffsetX: string | number;
  229. linkOffsetY: string | number;
  230. readonly centerX: number;
  231. readonly centerY: number;
  232. constructor(name?: string);
  233. protected _getTypeName(): string;
  234. getLocalCoordinates(globalCoordinates: Vector2): Vector2;
  235. getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
  236. getParentLocalCoordinates(globalCoordinates: Vector2): Vector2;
  237. moveToVector3(position: Vector3, scene: Scene): void;
  238. linkWithMesh(mesh: AbstractMesh): void;
  239. _moveToProjectedPosition(projectedPosition: Vector3): void;
  240. _markMatrixAsDirty(): void;
  241. _markAsDirty(): void;
  242. _markAllAsDirty(): void;
  243. _link(root: Container, host: AdvancedDynamicTexture): void;
  244. protected _transform(context: CanvasRenderingContext2D): void;
  245. protected _applyStates(context: CanvasRenderingContext2D): void;
  246. protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
  247. protected _clip(context: CanvasRenderingContext2D): void;
  248. _measure(): void;
  249. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  250. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  251. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  252. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  253. contains(x: number, y: number): boolean;
  254. _processPicking(x: number, y: number, type: number): boolean;
  255. protected _onPointerMove(coordinates: Vector2): void;
  256. protected _onPointerEnter(): boolean;
  257. _onPointerOut(): void;
  258. protected _onPointerDown(coordinates: Vector2): boolean;
  259. protected _onPointerUp(coordinates: Vector2): void;
  260. forcePointerUp(): void;
  261. _processObservables(type: number, x: number, y: number): boolean;
  262. private _prepareFont();
  263. dispose(): void;
  264. private static _HORIZONTAL_ALIGNMENT_LEFT;
  265. private static _HORIZONTAL_ALIGNMENT_RIGHT;
  266. private static _HORIZONTAL_ALIGNMENT_CENTER;
  267. private static _VERTICAL_ALIGNMENT_TOP;
  268. private static _VERTICAL_ALIGNMENT_BOTTOM;
  269. private static _VERTICAL_ALIGNMENT_CENTER;
  270. static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
  271. static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
  272. static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
  273. static readonly VERTICAL_ALIGNMENT_TOP: number;
  274. static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
  275. static readonly VERTICAL_ALIGNMENT_CENTER: number;
  276. private static _FontHeightSizes;
  277. static _GetFontOffset(font: string): {
  278. ascent: number;
  279. height: number;
  280. descent: number;
  281. };
  282. static AddHeader(control: Control, text: string, size: string | number, options: {
  283. isHorizontal: boolean;
  284. controlFirst: boolean;
  285. }): StackPanel;
  286. protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
  287. }
  288. }
  289. declare module BABYLON.GUI {
  290. class Container extends Control {
  291. name: string;
  292. protected _children: Control[];
  293. protected _measureForChildren: Measure;
  294. protected _background: string;
  295. background: string;
  296. readonly children: Control[];
  297. constructor(name?: string);
  298. protected _getTypeName(): string;
  299. getChildByName(name: string): Control;
  300. getChildByType(name: string, type: string): Control;
  301. containsControl(control: Control): boolean;
  302. addControl(control: Control): Container;
  303. removeControl(control: Control): Container;
  304. _reOrderControl(control: Control): void;
  305. _markMatrixAsDirty(): void;
  306. _markAllAsDirty(): void;
  307. protected _localDraw(context: CanvasRenderingContext2D): void;
  308. _link(root: Container, host: AdvancedDynamicTexture): void;
  309. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  310. _processPicking(x: number, y: number, type: number): boolean;
  311. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  312. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  313. dispose(): void;
  314. }
  315. }
  316. declare module BABYLON.GUI {
  317. class StackPanel extends Container {
  318. name: string;
  319. private _isVertical;
  320. private _manualWidth;
  321. private _manualHeight;
  322. private _doNotTrackManualChanges;
  323. private _tempMeasureStore;
  324. isVertical: boolean;
  325. width: string | number;
  326. height: string | number;
  327. constructor(name?: string);
  328. protected _getTypeName(): string;
  329. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  330. }
  331. }
  332. declare module BABYLON.GUI {
  333. class Rectangle extends Container {
  334. name: string;
  335. private _thickness;
  336. private _cornerRadius;
  337. thickness: number;
  338. cornerRadius: number;
  339. constructor(name?: string);
  340. protected _getTypeName(): string;
  341. protected _localDraw(context: CanvasRenderingContext2D): void;
  342. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  343. private _drawRoundedRect(context, offset?);
  344. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  345. }
  346. }
  347. declare module BABYLON.GUI {
  348. class Ellipse extends Container {
  349. name: string;
  350. private _thickness;
  351. thickness: number;
  352. constructor(name?: string);
  353. protected _getTypeName(): string;
  354. protected _localDraw(context: CanvasRenderingContext2D): void;
  355. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  356. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  357. }
  358. }
  359. declare module BABYLON.GUI {
  360. class Line extends Control {
  361. name: string;
  362. private _lineWidth;
  363. private _background;
  364. private _x1;
  365. private _y1;
  366. private _x2;
  367. private _y2;
  368. private _dash;
  369. private _connectedControl;
  370. private _connectedControlDirtyObserver;
  371. dash: Array<number>;
  372. connectedControl: Control;
  373. x1: string | number;
  374. y1: string | number;
  375. x2: string | number;
  376. y2: string | number;
  377. lineWidth: number;
  378. horizontalAlignment: number;
  379. verticalAlignment: number;
  380. private readonly _effectiveX2;
  381. private readonly _effectiveY2;
  382. constructor(name?: string);
  383. protected _getTypeName(): string;
  384. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  385. _measure(): void;
  386. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  387. _moveToProjectedPosition(projectedPosition: Vector3): void;
  388. }
  389. }
  390. declare module BABYLON.GUI {
  391. class Slider extends Control {
  392. name: string;
  393. private _thumbWidth;
  394. private _minimum;
  395. private _maximum;
  396. private _value;
  397. private _background;
  398. private _borderColor;
  399. private _barOffset;
  400. onValueChangedObservable: Observable<number>;
  401. borderColor: string;
  402. background: string;
  403. barOffset: string | number;
  404. thumbWidth: string | number;
  405. minimum: number;
  406. maximum: number;
  407. value: number;
  408. constructor(name?: string);
  409. protected _getTypeName(): string;
  410. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  411. private _pointerIsDown;
  412. private _updateValueFromPointer(x);
  413. protected _onPointerDown(coordinates: Vector2): boolean;
  414. protected _onPointerMove(coordinates: Vector2): void;
  415. protected _onPointerUp(coordinates: Vector2): void;
  416. }
  417. }
  418. declare module BABYLON.GUI {
  419. class Checkbox extends Control {
  420. name: string;
  421. private _isChecked;
  422. private _background;
  423. private _checkSizeRatio;
  424. private _thickness;
  425. thickness: number;
  426. onIsCheckedChangedObservable: Observable<boolean>;
  427. checkSizeRatio: number;
  428. background: string;
  429. isChecked: boolean;
  430. constructor(name?: string);
  431. protected _getTypeName(): string;
  432. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  433. protected _onPointerDown(coordinates: Vector2): boolean;
  434. }
  435. }
  436. declare module BABYLON.GUI {
  437. class RadioButton extends Control {
  438. name: string;
  439. private _isChecked;
  440. private _background;
  441. private _checkSizeRatio;
  442. private _thickness;
  443. thickness: number;
  444. group: string;
  445. onIsCheckedChangedObservable: Observable<boolean>;
  446. checkSizeRatio: number;
  447. background: string;
  448. isChecked: boolean;
  449. constructor(name?: string);
  450. protected _getTypeName(): string;
  451. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  452. protected _onPointerDown(coordinates: Vector2): boolean;
  453. }
  454. }
  455. declare module BABYLON.GUI {
  456. class TextBlock extends Control {
  457. name: string;
  458. private _text;
  459. private _textY;
  460. private _textWrapping;
  461. private _textHorizontalAlignment;
  462. private _textVerticalAlignment;
  463. private _lines;
  464. private _totalHeight;
  465. textWrapping: boolean;
  466. text: string;
  467. textHorizontalAlignment: number;
  468. textVerticalAlignment: number;
  469. constructor(name?: string, text?: string);
  470. protected _getTypeName(): string;
  471. private _drawText(text, textWidth, y, context);
  472. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  473. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  474. protected _parseLine(line: string, context: CanvasRenderingContext2D): object;
  475. protected _parseLineWithTextWrapping(line: string, context: CanvasRenderingContext2D): object;
  476. protected _renderLines(context: CanvasRenderingContext2D): void;
  477. }
  478. }
  479. declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
  480. declare module BABYLON.GUI {
  481. class Image extends Control {
  482. name: string;
  483. private _domImage;
  484. private _imageWidth;
  485. private _imageHeight;
  486. private _loaded;
  487. private _stretch;
  488. private _source;
  489. private _autoScale;
  490. private _sourceLeft;
  491. private _sourceTop;
  492. private _sourceWidth;
  493. private _sourceHeight;
  494. sourceLeft: number;
  495. sourceTop: number;
  496. sourceWidth: number;
  497. sourceHeight: number;
  498. autoScale: boolean;
  499. stretch: number;
  500. domImage: HTMLImageElement;
  501. private _onImageLoaded();
  502. source: string;
  503. constructor(name?: string, url?: string);
  504. protected _getTypeName(): string;
  505. synchronizeSizeWithContent(): void;
  506. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  507. private static _STRETCH_NONE;
  508. private static _STRETCH_FILL;
  509. private static _STRETCH_UNIFORM;
  510. private static _STRETCH_EXTEND;
  511. static readonly STRETCH_NONE: number;
  512. static readonly STRETCH_FILL: number;
  513. static readonly STRETCH_UNIFORM: number;
  514. static readonly STRETCH_EXTEND: number;
  515. }
  516. }
  517. declare module BABYLON.GUI {
  518. class Button extends Rectangle {
  519. name: string;
  520. pointerEnterAnimation: () => void;
  521. pointerOutAnimation: () => void;
  522. pointerDownAnimation: () => void;
  523. pointerUpAnimation: () => void;
  524. constructor(name?: string);
  525. protected _getTypeName(): string;
  526. _processPicking(x: number, y: number, type: number): boolean;
  527. protected _onPointerEnter(): boolean;
  528. _onPointerOut(): void;
  529. protected _onPointerDown(coordinates: Vector2): boolean;
  530. protected _onPointerUp(coordinates: Vector2): void;
  531. static CreateImageButton(name: string, text: string, imageUrl: string): Button;
  532. static CreateImageOnlyButton(name: string, imageUrl: string): Button;
  533. static CreateSimpleButton(name: string, text: string): Button;
  534. }
  535. }
  536. declare module BABYLON.GUI {
  537. class ColorPicker extends Control {
  538. name: string;
  539. private _colorWheelCanvas;
  540. private _value;
  541. private _tmpColor;
  542. private _pointerStartedOnSquare;
  543. private _pointerStartedOnWheel;
  544. private _squareLeft;
  545. private _squareTop;
  546. private _squareSize;
  547. private _h;
  548. private _s;
  549. private _v;
  550. onValueChangedObservable: Observable<Color3>;
  551. value: Color3;
  552. width: string | number;
  553. height: string | number;
  554. size: string | number;
  555. constructor(name?: string);
  556. protected _getTypeName(): string;
  557. private _updateSquareProps();
  558. private _drawGradientSquare(hueValue, left, top, width, height, context);
  559. private _drawCircle(centerX, centerY, radius, context);
  560. private _createColorWheelCanvas(radius, thickness);
  561. private _RGBtoHSV(color, result);
  562. private _HSVtoRGB(hue, saturation, value, result);
  563. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  564. private _pointerIsDown;
  565. private _updateValueFromPointer(x, y);
  566. private _isPointOnSquare(coordinates);
  567. private _isPointOnWheel(coordinates);
  568. protected _onPointerDown(coordinates: Vector2): boolean;
  569. protected _onPointerMove(coordinates: Vector2): void;
  570. protected _onPointerUp(coordinates: Vector2): void;
  571. }
  572. }
  573. declare module BABYLON.GUI {
  574. class InputText extends Control implements IFocusableControl {
  575. name: string;
  576. private _text;
  577. private _placeholderText;
  578. private _background;
  579. private _focusedBackground;
  580. private _placeholderColor;
  581. private _thickness;
  582. private _margin;
  583. private _autoStretchWidth;
  584. private _maxWidth;
  585. private _isFocused;
  586. private _blinkTimeout;
  587. private _blinkIsEven;
  588. private _cursorOffset;
  589. private _scrollLeft;
  590. promptMessage: string;
  591. onTextChangedObservable: Observable<InputText>;
  592. onFocusObservable: Observable<InputText>;
  593. onBlurObservable: Observable<InputText>;
  594. maxWidth: string | number;
  595. margin: string;
  596. autoStretchWidth: boolean;
  597. thickness: number;
  598. focusedBackground: string;
  599. background: string;
  600. placeholderColor: string;
  601. placeholderText: string;
  602. text: string;
  603. constructor(name?: string, text?: string);
  604. onBlur(): void;
  605. onFocus(): void;
  606. protected _getTypeName(): string;
  607. processKey(keyCode: number, key?: string): void;
  608. processKeyboard(evt: KeyboardEvent): void;
  609. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  610. protected _onPointerDown(coordinates: Vector2): boolean;
  611. protected _onPointerUp(coordinates: Vector2): void;
  612. dispose(): void;
  613. }
  614. }
  615. declare module BABYLON.GUI {
  616. class KeyPropertySet {
  617. width?: string;
  618. height?: string;
  619. paddingLeft?: string;
  620. paddingRight?: string;
  621. paddingTop?: string;
  622. paddingBottom?: string;
  623. color?: string;
  624. background?: string;
  625. }
  626. class VirtualKeyboard extends StackPanel {
  627. onKeyPressObservable: Observable<string>;
  628. defaultButtonWidth: string;
  629. defaultButtonHeight: string;
  630. defaultButtonPaddingLeft: string;
  631. defaultButtonPaddingRight: string;
  632. defaultButtonPaddingTop: string;
  633. defaultButtonPaddingBottom: string;
  634. defaultButtonColor: string;
  635. defaultButtonBackground: string;
  636. protected _getTypeName(): string;
  637. private _createKey(key, propertySet?);
  638. addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
  639. private _connectedInputText;
  640. private _onFocusObserver;
  641. private _onBlurObserver;
  642. private _onKeyPressObserver;
  643. readonly connectedInputText: InputText;
  644. connect(input: InputText): void;
  645. disconnect(): void;
  646. static CreateDefaultLayout(): VirtualKeyboard;
  647. }
  648. }