babylon.gui.d.ts 24 KB

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