babylon.gui.d.ts 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327
  1. /*BabylonJS GUI*/
  2. // Dependencies for this module:
  3. // ../../../../Tools/Gulp/babylonjs
  4. declare module BABYLON.GUI {
  5. }
  6. declare module BABYLON.GUI {
  7. }
  8. declare module BABYLON.GUI {
  9. }
  10. declare module BABYLON.GUI {
  11. }
  12. declare module BABYLON.GUI {
  13. /**
  14. * Interface used to define a control that can receive focus
  15. */
  16. export interface IFocusableControl {
  17. /**
  18. * Function called when the control receives the focus
  19. */
  20. onFocus(): void;
  21. /**
  22. * Function called when the control loses the focus
  23. */
  24. onBlur(): void;
  25. /**
  26. * Function called to let the control handle keyboard events
  27. * @param evt defines the current keyboard event
  28. */
  29. processKeyboard(evt: KeyboardEvent): void;
  30. }
  31. /**
  32. * Class used to create texture to support 2D GUI elements
  33. * @see http://doc.babylonjs.com/how_to/gui
  34. */
  35. export class AdvancedDynamicTexture extends BABYLON.DynamicTexture {
  36. /** @hidden */
  37. _rootContainer: Container;
  38. /** @hidden */
  39. _lastPickedControl: Control;
  40. /** @hidden */
  41. _lastControlOver: {
  42. [pointerId: number]: Control;
  43. };
  44. /** @hidden */
  45. _lastControlDown: {
  46. [pointerId: number]: Control;
  47. };
  48. /** @hidden */
  49. _capturingControl: {
  50. [pointerId: number]: Control;
  51. };
  52. /** @hidden */
  53. _shouldBlockPointer: boolean;
  54. /** @hidden */
  55. _layerToDispose: BABYLON.Nullable<BABYLON.Layer>;
  56. /** @hidden */
  57. _linkedControls: Control[];
  58. /**
  59. * Gets or sets a boolean defining if alpha is stored as premultiplied
  60. */
  61. premulAlpha: boolean;
  62. /**
  63. * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
  64. * Useful when you want more antialiasing
  65. */
  66. renderScale: number;
  67. /** Gets or sets the background color */
  68. background: string;
  69. /**
  70. * Gets or sets the ideal width used to design controls.
  71. * The GUI will then rescale everything accordingly
  72. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  73. */
  74. idealWidth: number;
  75. /**
  76. * Gets or sets the ideal height used to design controls.
  77. * The GUI will then rescale everything accordingly
  78. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  79. */
  80. idealHeight: number;
  81. /**
  82. * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
  83. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  84. */
  85. useSmallestIdeal: boolean;
  86. /**
  87. * Gets or sets a boolean indicating if adaptive scaling must be used
  88. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  89. */
  90. renderAtIdealSize: boolean;
  91. /**
  92. * Gets the underlying layer used to render the texture when in fullscreen mode
  93. */
  94. readonly layer: BABYLON.Nullable<BABYLON.Layer>;
  95. /**
  96. * Gets the root container control
  97. */
  98. readonly rootContainer: Container;
  99. /**
  100. * Gets or sets the current focused control
  101. */
  102. focusedControl: BABYLON.Nullable<IFocusableControl>;
  103. /**
  104. * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
  105. */
  106. isForeground: boolean;
  107. /**
  108. * Creates a new AdvancedDynamicTexture
  109. * @param name defines the name of the texture
  110. * @param width defines the width of the texture
  111. * @param height defines the height of the texture
  112. * @param scene defines the hosting scene
  113. * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
  114. * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
  115. */
  116. constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number);
  117. /**
  118. * Function used to execute a function on all controls
  119. * @param func defines the function to execute
  120. * @param container defines the container where controls belong. If null the root container will be used
  121. */
  122. executeOnAllControls(func: (control: Control) => void, container?: Container): void;
  123. /**
  124. * Marks the texture as dirty forcing a complete update
  125. */
  126. markAsDirty(): void;
  127. /**
  128. * Helper function used to create a new style
  129. * @returns a new style
  130. * @see http://doc.babylonjs.com/how_to/gui#styles
  131. */
  132. createStyle(): Style;
  133. /**
  134. * Adds a new control to the root container
  135. * @param control defines the control to add
  136. * @returns the current texture
  137. */
  138. addControl(control: Control): AdvancedDynamicTexture;
  139. /**
  140. * Removes a control from the root container
  141. * @param control defines the control to remove
  142. * @returns the current texture
  143. */
  144. removeControl(control: Control): AdvancedDynamicTexture;
  145. /**
  146. * Release all resources
  147. */
  148. dispose(): void;
  149. /** @hidden */
  150. _getGlobalViewport(scene: BABYLON.Scene): BABYLON.Viewport;
  151. /**
  152. * Get screen coordinates for a vector3
  153. * @param position defines the position to project
  154. * @param worldMatrix defines the world matrix to use
  155. * @returns the projected position
  156. */
  157. getProjectedPosition(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector2;
  158. /** @hidden */
  159. _cleanControlAfterRemovalFromList(list: {
  160. [pointerId: number]: Control;
  161. }, control: Control): void;
  162. /** @hidden */
  163. _cleanControlAfterRemoval(control: Control): void;
  164. /** Attach to all scene events required to support pointer events */
  165. attach(): void;
  166. /**
  167. * Connect the texture to a hosting mesh to enable interactions
  168. * @param mesh defines the mesh to attach to
  169. * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
  170. */
  171. attachToMesh(mesh: BABYLON.AbstractMesh, supportPointerMove?: boolean): void;
  172. /**
  173. * Move the focus to a specific control
  174. * @param control defines the control which will receive the focus
  175. */
  176. moveFocusToControl(control: IFocusableControl): void;
  177. /**
  178. * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
  179. * @param mesh defines the mesh which will receive the texture
  180. * @param width defines the texture width (1024 by default)
  181. * @param height defines the texture height (1024 by default)
  182. * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
  183. * @returns a new AdvancedDynamicTexture
  184. */
  185. static CreateForMesh(mesh: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
  186. /**
  187. * Creates a new AdvancedDynamicTexture in fullscreen mode.
  188. * In this mode the texture will rely on a layer for its rendering.
  189. * This allows it to be treated like any other layer.
  190. * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
  191. * LayerMask is set through advancedTexture.layer.layerMask
  192. * @param name defines name for the texture
  193. * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
  194. * @param scene defines the hsoting scene
  195. * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
  196. * @returns a new AdvancedDynamicTexture
  197. */
  198. static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number): AdvancedDynamicTexture;
  199. }
  200. }
  201. declare module BABYLON.GUI {
  202. /**
  203. * Class used to transport BABYLON.Vector2 information for pointer events
  204. */
  205. export class Vector2WithInfo extends BABYLON.Vector2 {
  206. /** defines the current mouse button index */
  207. buttonIndex: number;
  208. /**
  209. * Creates a new Vector2WithInfo
  210. * @param source defines the vector2 data to transport
  211. * @param buttonIndex defines the current mouse button index
  212. */
  213. constructor(source: BABYLON.Vector2,
  214. /** defines the current mouse button index */
  215. buttonIndex?: number);
  216. }
  217. /** Class used to provide 2D matrix features */
  218. export class Matrix2D {
  219. /** Gets the internal array of 6 floats used to store matrix data */
  220. m: Float32Array;
  221. /**
  222. * Creates a new matrix
  223. * @param m00 defines value for (0, 0)
  224. * @param m01 defines value for (0, 1)
  225. * @param m10 defines value for (1, 0)
  226. * @param m11 defines value for (1, 1)
  227. * @param m20 defines value for (2, 0)
  228. * @param m21 defines value for (2, 1)
  229. */
  230. constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
  231. /**
  232. * Fills the matrix from direct values
  233. * @param m00 defines value for (0, 0)
  234. * @param m01 defines value for (0, 1)
  235. * @param m10 defines value for (1, 0)
  236. * @param m11 defines value for (1, 1)
  237. * @param m20 defines value for (2, 0)
  238. * @param m21 defines value for (2, 1)
  239. * @returns the current modified matrix
  240. */
  241. fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
  242. /**
  243. * Gets matrix determinant
  244. * @returns the determinant
  245. */
  246. determinant(): number;
  247. /**
  248. * Inverses the matrix and stores it in a target matrix
  249. * @param result defines the target matrix
  250. * @returns the current matrix
  251. */
  252. invertToRef(result: Matrix2D): Matrix2D;
  253. /**
  254. * Multiplies the current matrix with another one
  255. * @param other defines the second operand
  256. * @param result defines the target matrix
  257. * @returns the current matrix
  258. */
  259. multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
  260. /**
  261. * Applies the current matrix to a set of 2 floats and stores the result in a vector2
  262. * @param x defines the x coordinate to transform
  263. * @param y defines the x coordinate to transform
  264. * @param result defines the target vector2
  265. * @returns the current matrix
  266. */
  267. transformCoordinates(x: number, y: number, result: BABYLON.Vector2): Matrix2D;
  268. /**
  269. * Creates an identity matrix
  270. * @returns a new matrix
  271. */
  272. static Identity(): Matrix2D;
  273. /**
  274. * Creates a translation matrix and stores it in a target matrix
  275. * @param x defines the x coordinate of the translation
  276. * @param y defines the y coordinate of the translation
  277. * @param result defines the target matrix
  278. */
  279. static TranslationToRef(x: number, y: number, result: Matrix2D): void;
  280. /**
  281. * Creates a scaling matrix and stores it in a target matrix
  282. * @param x defines the x coordinate of the scaling
  283. * @param y defines the y coordinate of the scaling
  284. * @param result defines the target matrix
  285. */
  286. static ScalingToRef(x: number, y: number, result: Matrix2D): void;
  287. /**
  288. * Creates a rotation matrix and stores it in a target matrix
  289. * @param angle defines the rotation angle
  290. * @param result defines the target matrix
  291. */
  292. static RotationToRef(angle: number, result: Matrix2D): void;
  293. /**
  294. * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
  295. * @param tx defines the x coordinate of the translation
  296. * @param ty defines the y coordinate of the translation
  297. * @param angle defines the rotation angle
  298. * @param scaleX defines the x coordinate of the scaling
  299. * @param scaleY defines the y coordinate of the scaling
  300. * @param parentMatrix defines the parent matrix to multiply by (can be null)
  301. * @param result defines the target matrix
  302. */
  303. static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: BABYLON.Nullable<Matrix2D>, result: Matrix2D): void;
  304. }
  305. }
  306. declare module BABYLON.GUI {
  307. /**
  308. * Class used to store 2D control sizes
  309. */
  310. export class Measure {
  311. /** defines left coordinate */
  312. left: number;
  313. /** defines top coordinate */
  314. top: number;
  315. /** defines width dimension */
  316. width: number;
  317. /** defines height dimension */
  318. height: number;
  319. /**
  320. * Creates a new measure
  321. * @param left defines left coordinate
  322. * @param top defines top coordinate
  323. * @param width defines width dimension
  324. * @param height defines height dimension
  325. */
  326. constructor(
  327. /** defines left coordinate */
  328. left: number,
  329. /** defines top coordinate */
  330. top: number,
  331. /** defines width dimension */
  332. width: number,
  333. /** defines height dimension */
  334. height: number);
  335. /**
  336. * Copy from another measure
  337. * @param other defines the other measure to copy from
  338. */
  339. copyFrom(other: Measure): void;
  340. /**
  341. * Check equality between this measure and another one
  342. * @param other defines the other measures
  343. * @returns true if both measures are equals
  344. */
  345. isEqualsTo(other: Measure): boolean;
  346. /**
  347. * Creates an empty measure
  348. * @returns a new measure
  349. */
  350. static Empty(): Measure;
  351. }
  352. }
  353. declare module BABYLON.GUI {
  354. /**
  355. * Class used to store a point for a MultiLine object.
  356. * The point can be pure 2D coordinates, a mesh or a control
  357. */
  358. export class MultiLinePoint {
  359. /** @hidden */
  360. _point: BABYLON.Vector2;
  361. /**
  362. * Creates a new MultiLinePoint
  363. * @param multiLine defines the source MultiLine object
  364. */
  365. constructor(multiLine: MultiLine);
  366. /** Gets or sets x coordinate */
  367. x: string | number;
  368. /** Gets or sets y coordinate */
  369. y: string | number;
  370. /** Gets or sets the control associated with this point */
  371. control: BABYLON.Nullable<Control>;
  372. /** Gets or sets the mesh associated with this point */
  373. mesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  374. /**
  375. * Gets a translation vector
  376. * @returns the translation vector
  377. */
  378. translate(): BABYLON.Vector2;
  379. /** Release associated resources */
  380. dispose(): void;
  381. }
  382. }
  383. declare module BABYLON.GUI {
  384. /**
  385. * Define a style used by control to automatically setup properties based on a template.
  386. * Only support font related properties so far
  387. */
  388. export class Style implements BABYLON.IDisposable {
  389. /** @hidden */
  390. _host: AdvancedDynamicTexture;
  391. /** @hidden */
  392. _fontSize: ValueAndUnit;
  393. /**
  394. * BABYLON.Observable raised when the style values are changed
  395. */
  396. onChangedObservable: BABYLON.Observable<Style>;
  397. /**
  398. * Creates a new style object
  399. * @param host defines the AdvancedDynamicTexture which hosts this style
  400. */
  401. constructor(host: AdvancedDynamicTexture);
  402. /**
  403. * Gets or sets the font size
  404. */
  405. fontSize: string | number;
  406. /**
  407. * Gets or sets the font family
  408. */
  409. fontFamily: string;
  410. /**
  411. * Gets or sets the font style
  412. */
  413. fontStyle: string;
  414. /** Gets or sets font weight */
  415. fontWeight: string;
  416. /** Dispose all associated resources */
  417. dispose(): void;
  418. }
  419. }
  420. declare module BABYLON.GUI {
  421. /**
  422. * Class used to specific a value and its associated unit
  423. */
  424. export class ValueAndUnit {
  425. /** defines the unit to store */
  426. unit: number;
  427. /** defines a boolean indicating if the value can be negative */
  428. negativeValueAllowed: boolean;
  429. /**
  430. * Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
  431. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  432. */
  433. ignoreAdaptiveScaling: boolean;
  434. /**
  435. * Creates a new ValueAndUnit
  436. * @param value defines the value to store
  437. * @param unit defines the unit to store
  438. * @param negativeValueAllowed defines a boolean indicating if the value can be negative
  439. */
  440. constructor(value: number,
  441. /** defines the unit to store */
  442. unit?: number,
  443. /** defines a boolean indicating if the value can be negative */
  444. negativeValueAllowed?: boolean);
  445. /** Gets a boolean indicating if the value is a percentage */
  446. readonly isPercentage: boolean;
  447. /** Gets a boolean indicating if the value is store as pixel */
  448. readonly isPixel: boolean;
  449. /** Gets direct internal value */
  450. readonly internalValue: number;
  451. /**
  452. * Gets value as pixel
  453. * @param host defines the root host
  454. * @param refValue defines the reference value for percentages
  455. * @returns the value as pixel
  456. */
  457. getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
  458. /**
  459. * Gets the value accordingly to its unit
  460. * @param host defines the root host
  461. * @returns the value
  462. */
  463. getValue(host: AdvancedDynamicTexture): number;
  464. /**
  465. * Gets a string representation of the value
  466. * @param host defines the root host
  467. * @returns a string
  468. */
  469. toString(host: AdvancedDynamicTexture): string;
  470. /**
  471. * Store a value parsed from a string
  472. * @param source defines the source string
  473. * @returns true if the value was successfully parsed
  474. */
  475. fromString(source: string | number): boolean;
  476. /** UNITMODE_PERCENTAGE */
  477. static readonly UNITMODE_PERCENTAGE: number;
  478. /** UNITMODE_PIXEL */
  479. static readonly UNITMODE_PIXEL: number;
  480. }
  481. }
  482. declare module BABYLON.GUI {
  483. }
  484. declare module BABYLON.GUI {
  485. }
  486. declare module BABYLON.GUI {
  487. /**
  488. * Class used to manage 3D user interface
  489. * @see http://doc.babylonjs.com/how_to/gui3d
  490. */
  491. export class GUI3DManager implements BABYLON.IDisposable {
  492. /** @hidden */
  493. _lastPickedControl: Control3D;
  494. /** @hidden */
  495. _lastControlOver: {
  496. [pointerId: number]: Control3D;
  497. };
  498. /** @hidden */
  499. _lastControlDown: {
  500. [pointerId: number]: Control3D;
  501. };
  502. /**
  503. * BABYLON.Observable raised when the point picked by the pointer events changed
  504. */
  505. onPickedPointChangedObservable: BABYLON.Observable<BABYLON.Nullable<BABYLON.Vector3>>;
  506. /** @hidden */
  507. _sharedMaterials: {
  508. [key: string]: BABYLON.Material;
  509. };
  510. /** Gets the hosting scene */
  511. readonly scene: BABYLON.Scene;
  512. /** Gets associated utility layer */
  513. readonly utilityLayer: BABYLON.Nullable<BABYLON.UtilityLayerRenderer>;
  514. /**
  515. * Creates a new GUI3DManager
  516. * @param scene
  517. */
  518. constructor(scene?: BABYLON.Scene);
  519. /**
  520. * Gets the root container
  521. */
  522. readonly rootContainer: Container3D;
  523. /**
  524. * Gets a boolean indicating if the given control is in the root child list
  525. * @param control defines the control to check
  526. * @returns true if the control is in the root child list
  527. */
  528. containsControl(control: Control3D): boolean;
  529. /**
  530. * Adds a control to the root child list
  531. * @param control defines the control to add
  532. * @returns the current manager
  533. */
  534. addControl(control: Control3D): GUI3DManager;
  535. /**
  536. * Removes a control from the root child list
  537. * @param control defines the control to remove
  538. * @returns the current container
  539. */
  540. removeControl(control: Control3D): GUI3DManager;
  541. /**
  542. * Releases all associated resources
  543. */
  544. dispose(): void;
  545. }
  546. }
  547. declare module BABYLON.GUI {
  548. /**
  549. * Class used to transport BABYLON.Vector3 information for pointer events
  550. */
  551. export class Vector3WithInfo extends BABYLON.Vector3 {
  552. /** defines the current mouse button index */
  553. buttonIndex: number;
  554. /**
  555. * Creates a new Vector3WithInfo
  556. * @param source defines the vector3 data to transport
  557. * @param buttonIndex defines the current mouse button index
  558. */
  559. constructor(source: BABYLON.Vector3,
  560. /** defines the current mouse button index */
  561. buttonIndex?: number);
  562. }
  563. }
  564. declare module BABYLON.GUI {
  565. /**
  566. * Class used to create 2D buttons
  567. */
  568. export class Button extends Rectangle {
  569. name?: string | undefined;
  570. /**
  571. * Function called to generate a pointer enter animation
  572. */
  573. pointerEnterAnimation: () => void;
  574. /**
  575. * Function called to generate a pointer out animation
  576. */
  577. pointerOutAnimation: () => void;
  578. /**
  579. * Function called to generate a pointer down animation
  580. */
  581. pointerDownAnimation: () => void;
  582. /**
  583. * Function called to generate a pointer up animation
  584. */
  585. pointerUpAnimation: () => void;
  586. /**
  587. * Creates a new Button
  588. * @param name defines the name of the button
  589. */
  590. constructor(name?: string | undefined);
  591. protected _getTypeName(): string;
  592. /** @hidden */
  593. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  594. /** @hidden */
  595. _onPointerEnter(target: Control): boolean;
  596. /** @hidden */
  597. _onPointerOut(target: Control): void;
  598. /** @hidden */
  599. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  600. /** @hidden */
  601. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  602. /**
  603. * Creates a new button made with an image and a text
  604. * @param name defines the name of the button
  605. * @param text defines the text of the button
  606. * @param imageUrl defines the url of the image
  607. * @returns a new Button
  608. */
  609. static CreateImageButton(name: string, text: string, imageUrl: string): Button;
  610. /**
  611. * Creates a new button made with an image
  612. * @param name defines the name of the button
  613. * @param imageUrl defines the url of the image
  614. * @returns a new Button
  615. */
  616. static CreateImageOnlyButton(name: string, imageUrl: string): Button;
  617. /**
  618. * Creates a new button made with a text
  619. * @param name defines the name of the button
  620. * @param text defines the text of the button
  621. * @returns a new Button
  622. */
  623. static CreateSimpleButton(name: string, text: string): Button;
  624. /**
  625. * Creates a new button made with an image and a centered text
  626. * @param name defines the name of the button
  627. * @param text defines the text of the button
  628. * @param imageUrl defines the url of the image
  629. * @returns a new Button
  630. */
  631. static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
  632. }
  633. }
  634. declare module BABYLON.GUI {
  635. /**
  636. * Class used to represent a 2D checkbox
  637. */
  638. export class Checkbox extends Control {
  639. name?: string | undefined;
  640. /** Gets or sets border thickness */
  641. thickness: number;
  642. /**
  643. * BABYLON.Observable raised when isChecked property changes
  644. */
  645. onIsCheckedChangedObservable: BABYLON.Observable<boolean>;
  646. /** Gets or sets a value indicating the ratio between overall size and check size */
  647. checkSizeRatio: number;
  648. /** Gets or sets background color */
  649. background: string;
  650. /** Gets or sets a boolean indicating if the checkbox is checked or not */
  651. isChecked: boolean;
  652. /**
  653. * Creates a new CheckBox
  654. * @param name defines the control name
  655. */
  656. constructor(name?: string | undefined);
  657. protected _getTypeName(): string;
  658. /** @hidden */
  659. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  660. /** @hidden */
  661. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  662. }
  663. }
  664. declare module BABYLON.GUI {
  665. /** Class used to create color pickers */
  666. export class ColorPicker extends Control {
  667. name?: string | undefined;
  668. /**
  669. * BABYLON.Observable raised when the value changes
  670. */
  671. onValueChangedObservable: BABYLON.Observable<BABYLON.Color3>;
  672. /** Gets or sets the color of the color picker */
  673. value: BABYLON.Color3;
  674. /** Gets or sets control width */
  675. width: string | number;
  676. /** Gets or sets control height */
  677. height: string | number;
  678. /** Gets or sets control size */
  679. size: string | number;
  680. /**
  681. * Creates a new ColorPicker
  682. * @param name defines the control name
  683. */
  684. constructor(name?: string | undefined);
  685. protected _getTypeName(): string;
  686. /** @hidden */
  687. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  688. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  689. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  690. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  691. }
  692. }
  693. declare module BABYLON.GUI {
  694. /**
  695. * Root class for 2D containers
  696. * @see http://doc.babylonjs.com/how_to/gui#containers
  697. */
  698. export class Container extends Control {
  699. name?: string | undefined;
  700. /** @hidden */
  701. protected _children: Control[];
  702. /** @hidden */
  703. protected _measureForChildren: Measure;
  704. /** @hidden */
  705. protected _background: string;
  706. /** @hidden */
  707. protected _adaptWidthToChildren: boolean;
  708. /** @hidden */
  709. protected _adaptHeightToChildren: boolean;
  710. /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
  711. adaptHeightToChildren: boolean;
  712. /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
  713. adaptWidthToChildren: boolean;
  714. /** Gets or sets background color */
  715. background: string;
  716. /** Gets the list of children */
  717. readonly children: Control[];
  718. /**
  719. * Creates a new Container
  720. * @param name defines the name of the container
  721. */
  722. constructor(name?: string | undefined);
  723. protected _getTypeName(): string;
  724. /**
  725. * Gets a child using its name
  726. * @param name defines the child name to look for
  727. * @returns the child control if found
  728. */
  729. getChildByName(name: string): BABYLON.Nullable<Control>;
  730. /**
  731. * Gets a child using its type and its name
  732. * @param name defines the child name to look for
  733. * @param type defines the child type to look for
  734. * @returns the child control if found
  735. */
  736. getChildByType(name: string, type: string): BABYLON.Nullable<Control>;
  737. /**
  738. * Search for a specific control in children
  739. * @param control defines the control to look for
  740. * @returns true if the control is in child list
  741. */
  742. containsControl(control: Control): boolean;
  743. /**
  744. * Adds a new control to the current container
  745. * @param control defines the control to add
  746. * @returns the current container
  747. */
  748. addControl(control: BABYLON.Nullable<Control>): Container;
  749. /**
  750. * Removes a control from the current container
  751. * @param control defines the control to remove
  752. * @returns the current container
  753. */
  754. removeControl(control: Control): Container;
  755. /** @hidden */
  756. _reOrderControl(control: Control): void;
  757. /** @hidden */
  758. _markMatrixAsDirty(): void;
  759. /** @hidden */
  760. _markAllAsDirty(): void;
  761. /** @hidden */
  762. protected _localDraw(context: CanvasRenderingContext2D): void;
  763. /** @hidden */
  764. _link(root: BABYLON.Nullable<Container>, host: AdvancedDynamicTexture): void;
  765. /** @hidden */
  766. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  767. /** @hidden */
  768. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  769. /** @hidden */
  770. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  771. /** @hidden */
  772. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  773. /** Releases associated resources */
  774. dispose(): void;
  775. }
  776. }
  777. declare module BABYLON.GUI {
  778. /**
  779. * Root class used for all 2D controls
  780. * @see http://doc.babylonjs.com/how_to/gui#controls
  781. */
  782. export class Control {
  783. /** defines the name of the control */
  784. name?: string | undefined;
  785. /** @hidden */
  786. _root: BABYLON.Nullable<Container>;
  787. /** @hidden */
  788. _host: AdvancedDynamicTexture;
  789. /** Gets or sets the control parent */
  790. parent: BABYLON.Nullable<Container>;
  791. /** @hidden */
  792. _currentMeasure: Measure;
  793. /** @hidden */
  794. _width: ValueAndUnit;
  795. /** @hidden */
  796. _height: ValueAndUnit;
  797. /** @hidden */
  798. protected _fontOffset: {
  799. ascent: number;
  800. height: number;
  801. descent: number;
  802. };
  803. /** @hidden */
  804. protected _horizontalAlignment: number;
  805. /** @hidden */
  806. protected _verticalAlignment: number;
  807. /** @hidden */
  808. _tempParentMeasure: Measure;
  809. /** @hidden */
  810. protected _cachedParentMeasure: Measure;
  811. /** @hidden */
  812. _left: ValueAndUnit;
  813. /** @hidden */
  814. _top: ValueAndUnit;
  815. /** @hidden */
  816. protected _invertTransformMatrix: Matrix2D;
  817. /** @hidden */
  818. protected _transformedPosition: BABYLON.Vector2;
  819. /** @hidden */
  820. _linkedMesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  821. /** @hidden */
  822. _tag: any;
  823. /** Gets or sets a boolean indicating if the control can be hit with pointer events */
  824. isHitTestVisible: boolean;
  825. /** Gets or sets a boolean indicating if the control can block pointer events */
  826. isPointerBlocker: boolean;
  827. /** Gets or sets a boolean indicating if the control can be focusable */
  828. isFocusInvisible: boolean;
  829. /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
  830. shadowOffsetX: number;
  831. /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
  832. shadowOffsetY: number;
  833. /** Gets or sets a value indicating the amount of blur to use to render the shadow */
  834. shadowBlur: number;
  835. /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
  836. shadowColor: string;
  837. /** @hidden */
  838. protected _linkOffsetX: ValueAndUnit;
  839. /** @hidden */
  840. protected _linkOffsetY: ValueAndUnit;
  841. /** Gets the control type name */
  842. readonly typeName: string;
  843. /**
  844. * An event triggered when the pointer move over the control.
  845. */
  846. onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector2>;
  847. /**
  848. * An event triggered when the pointer move out of the control.
  849. */
  850. onPointerOutObservable: BABYLON.Observable<Control>;
  851. /**
  852. * An event triggered when the pointer taps the control
  853. */
  854. onPointerDownObservable: BABYLON.Observable<Vector2WithInfo>;
  855. /**
  856. * An event triggered when pointer up
  857. */
  858. onPointerUpObservable: BABYLON.Observable<Vector2WithInfo>;
  859. /**
  860. * An event triggered when a control is clicked on
  861. */
  862. onPointerClickObservable: BABYLON.Observable<Vector2WithInfo>;
  863. /**
  864. * An event triggered when pointer enters the control
  865. */
  866. onPointerEnterObservable: BABYLON.Observable<Control>;
  867. /**
  868. * An event triggered when the control is marked as dirty
  869. */
  870. onDirtyObservable: BABYLON.Observable<Control>;
  871. /**
  872. * An event triggered after the control is drawn
  873. */
  874. onAfterDrawObservable: BABYLON.Observable<Control>;
  875. /** Gets or set information about font offsets (used to render and align text) */
  876. fontOffset: {
  877. ascent: number;
  878. height: number;
  879. descent: number;
  880. };
  881. /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
  882. alpha: number;
  883. /** Gets or sets a value indicating the scale factor on X axis (1 by default)
  884. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  885. */
  886. scaleX: number;
  887. /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
  888. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  889. */
  890. scaleY: number;
  891. /** Gets or sets the rotation angle (0 by default)
  892. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  893. */
  894. rotation: number;
  895. /** Gets or sets the transformation center on Y axis (0 by default)
  896. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  897. */
  898. transformCenterY: number;
  899. /** Gets or sets the transformation center on X axis (0 by default)
  900. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  901. */
  902. transformCenterX: number;
  903. /**
  904. * Gets or sets the horizontal alignment
  905. * @see http://doc.babylonjs.com/how_to/gui#alignments
  906. */
  907. horizontalAlignment: number;
  908. /**
  909. * Gets or sets the vertical alignment
  910. * @see http://doc.babylonjs.com/how_to/gui#alignments
  911. */
  912. verticalAlignment: number;
  913. /**
  914. * Gets or sets control width
  915. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  916. */
  917. width: string | number;
  918. /**
  919. * Gets control width in pixel
  920. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  921. */
  922. readonly widthInPixels: number;
  923. /**
  924. * Gets or sets control height
  925. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  926. */
  927. height: string | number;
  928. /**
  929. * Gets control height in pixel
  930. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  931. */
  932. readonly heightInPixels: number;
  933. /** Gets or set font family */
  934. fontFamily: string;
  935. /** Gets or sets font style */
  936. fontStyle: string;
  937. /** Gets or sets font weight */
  938. fontWeight: string;
  939. /**
  940. * Gets or sets style
  941. * @see http://doc.babylonjs.com/how_to/gui#styles
  942. */
  943. style: BABYLON.Nullable<Style>;
  944. /** @hidden */
  945. readonly _isFontSizeInPercentage: boolean;
  946. /** Gets font size in pixels */
  947. readonly fontSizeInPixels: number;
  948. /** Gets or sets font size */
  949. fontSize: string | number;
  950. /** Gets or sets foreground color */
  951. color: string;
  952. /** Gets or sets z index which is used to reorder controls on the z axis */
  953. zIndex: number;
  954. /** Gets or sets a boolean indicating if the control can be rendered */
  955. notRenderable: boolean;
  956. /** Gets or sets a boolean indicating if the control is visible */
  957. isVisible: boolean;
  958. /** Gets a boolean indicating that the control needs to update its rendering */
  959. readonly isDirty: boolean;
  960. /**
  961. * Gets or sets a value indicating the padding to use on the left of the control
  962. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  963. */
  964. paddingLeft: string | number;
  965. /**
  966. * Gets a value indicating the padding in pixels to use on the left of the control
  967. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  968. */
  969. readonly paddingLeftInPixels: number;
  970. /**
  971. * Gets or sets a value indicating the padding to use on the right of the control
  972. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  973. */
  974. paddingRight: string | number;
  975. /**
  976. * Gets a value indicating the padding in pixels to use on the right of the control
  977. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  978. */
  979. readonly paddingRightInPixels: number;
  980. /**
  981. * Gets or sets a value indicating the padding to use on the top of the control
  982. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  983. */
  984. paddingTop: string | number;
  985. /**
  986. * Gets a value indicating the padding in pixels to use on the top of the control
  987. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  988. */
  989. readonly paddingTopInPixels: number;
  990. /**
  991. * Gets or sets a value indicating the padding to use on the bottom of the control
  992. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  993. */
  994. paddingBottom: string | number;
  995. /**
  996. * Gets a value indicating the padding in pixels to use on the bottom of the control
  997. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  998. */
  999. readonly paddingBottomInPixels: number;
  1000. /**
  1001. * Gets or sets a value indicating the left coordinate of the control
  1002. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1003. */
  1004. left: string | number;
  1005. /**
  1006. * Gets a value indicating the left coordinate in pixels of the control
  1007. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1008. */
  1009. readonly leftInPixels: number;
  1010. /**
  1011. * Gets or sets a value indicating the top coordinate of the control
  1012. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1013. */
  1014. top: string | number;
  1015. /**
  1016. * Gets a value indicating the top coordinate in pixels of the control
  1017. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1018. */
  1019. readonly topInPixels: number;
  1020. /**
  1021. * Gets or sets a value indicating the offset on X axis to the linked mesh
  1022. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1023. */
  1024. linkOffsetX: string | number;
  1025. /**
  1026. * Gets a value indicating the offset in pixels on X axis to the linked mesh
  1027. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1028. */
  1029. readonly linkOffsetXInPixels: number;
  1030. /**
  1031. * Gets or sets a value indicating the offset on Y axis to the linked mesh
  1032. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1033. */
  1034. linkOffsetY: string | number;
  1035. /**
  1036. * Gets a value indicating the offset in pixels on Y axis to the linked mesh
  1037. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1038. */
  1039. readonly linkOffsetYInPixels: number;
  1040. /** Gets the center coordinate on X axis */
  1041. readonly centerX: number;
  1042. /** Gets the center coordinate on Y axis */
  1043. readonly centerY: number;
  1044. /**
  1045. * Creates a new control
  1046. * @param name defines the name of the control
  1047. */
  1048. constructor(
  1049. /** defines the name of the control */
  1050. name?: string | undefined);
  1051. /** @hidden */
  1052. protected _getTypeName(): string;
  1053. /** @hidden */
  1054. _resetFontCache(): void;
  1055. /**
  1056. * Gets coordinates in local control space
  1057. * @param globalCoordinates defines the coordinates to transform
  1058. * @returns the new coordinates in local space
  1059. */
  1060. getLocalCoordinates(globalCoordinates: BABYLON.Vector2): BABYLON.Vector2;
  1061. /**
  1062. * Gets coordinates in local control space
  1063. * @param globalCoordinates defines the coordinates to transform
  1064. * @param result defines the target vector2 where to store the result
  1065. * @returns the current control
  1066. */
  1067. getLocalCoordinatesToRef(globalCoordinates: BABYLON.Vector2, result: BABYLON.Vector2): Control;
  1068. /**
  1069. * Gets coordinates in parent local control space
  1070. * @param globalCoordinates defines the coordinates to transform
  1071. * @returns the new coordinates in parent local space
  1072. */
  1073. getParentLocalCoordinates(globalCoordinates: BABYLON.Vector2): BABYLON.Vector2;
  1074. /**
  1075. * Move the current control to a vector3 position projected onto the screen.
  1076. * @param position defines the target position
  1077. * @param scene defines the hosting scene
  1078. */
  1079. moveToVector3(position: BABYLON.Vector3, scene: BABYLON.Scene): void;
  1080. /**
  1081. * Link current control with a target mesh
  1082. * @param mesh defines the mesh to link with
  1083. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1084. */
  1085. linkWithMesh(mesh: BABYLON.Nullable<BABYLON.AbstractMesh>): void;
  1086. /** @hidden */
  1087. _moveToProjectedPosition(projectedPosition: BABYLON.Vector3): void;
  1088. /** @hidden */
  1089. _markMatrixAsDirty(): void;
  1090. /** @hidden */
  1091. _markAsDirty(): void;
  1092. /** @hidden */
  1093. _markAllAsDirty(): void;
  1094. /** @hidden */
  1095. _link(root: BABYLON.Nullable<Container>, host: AdvancedDynamicTexture): void;
  1096. /** @hidden */
  1097. protected _transform(context: CanvasRenderingContext2D): void;
  1098. /** @hidden */
  1099. protected _applyStates(context: CanvasRenderingContext2D): void;
  1100. /** @hidden */
  1101. protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
  1102. /** @hidden */
  1103. protected _clip(context: CanvasRenderingContext2D): void;
  1104. /** @hidden */
  1105. _measure(): void;
  1106. /** @hidden */
  1107. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1108. /** @hidden */
  1109. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1110. /** @hidden */
  1111. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1112. /** @hidden */
  1113. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1114. /**
  1115. * Tests if a given coordinates belong to the current control
  1116. * @param x defines x coordinate to test
  1117. * @param y defines y coordinate to test
  1118. * @returns true if the coordinates are inside the control
  1119. */
  1120. contains(x: number, y: number): boolean;
  1121. /** @hidden */
  1122. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  1123. /** @hidden */
  1124. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  1125. /** @hidden */
  1126. _onPointerEnter(target: Control): boolean;
  1127. /** @hidden */
  1128. _onPointerOut(target: Control): void;
  1129. /** @hidden */
  1130. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1131. /** @hidden */
  1132. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  1133. /** @hidden */
  1134. _forcePointerUp(pointerId?: BABYLON.Nullable<number>): void;
  1135. /** @hidden */
  1136. _processObservables(type: number, x: number, y: number, pointerId: number, buttonIndex: number): boolean;
  1137. /** Releases associated resources */
  1138. dispose(): void;
  1139. /** HORIZONTAL_ALIGNMENT_LEFT */
  1140. static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
  1141. /** HORIZONTAL_ALIGNMENT_RIGHT */
  1142. static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
  1143. /** HORIZONTAL_ALIGNMENT_CENTER */
  1144. static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
  1145. /** VERTICAL_ALIGNMENT_TOP */
  1146. static readonly VERTICAL_ALIGNMENT_TOP: number;
  1147. /** VERTICAL_ALIGNMENT_BOTTOM */
  1148. static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
  1149. /** VERTICAL_ALIGNMENT_CENTER */
  1150. static readonly VERTICAL_ALIGNMENT_CENTER: number;
  1151. /** @hidden */
  1152. static _GetFontOffset(font: string): {
  1153. ascent: number;
  1154. height: number;
  1155. descent: number;
  1156. };
  1157. /**
  1158. * Creates a stack panel that can be used to render headers
  1159. * @param control defines the control to associate with the header
  1160. * @param text defines the text of the header
  1161. * @param size defines the size of the header
  1162. * @param options defines options used to configure the header
  1163. * @returns a new StackPanel
  1164. * @ignore
  1165. * @hidden
  1166. */
  1167. static AddHeader: (control: Control, text: string, size: string | number, options: {
  1168. isHorizontal: boolean;
  1169. controlFirst: boolean;
  1170. }) => any;
  1171. /** @hidden */
  1172. protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
  1173. }
  1174. }
  1175. declare module BABYLON.GUI {
  1176. /** Class used to create 2D ellipse containers */
  1177. export class Ellipse extends Container {
  1178. name?: string | undefined;
  1179. /** Gets or sets border thickness */
  1180. thickness: number;
  1181. /**
  1182. * Creates a new Ellipse
  1183. * @param name defines the control name
  1184. */
  1185. constructor(name?: string | undefined);
  1186. protected _getTypeName(): string;
  1187. protected _localDraw(context: CanvasRenderingContext2D): void;
  1188. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1189. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  1190. }
  1191. }
  1192. declare module BABYLON.GUI {
  1193. /**
  1194. * Class used to create a 2D grid container
  1195. */
  1196. export class Grid extends Container {
  1197. name?: string | undefined;
  1198. /** Gets the list of children */
  1199. readonly children: Control[];
  1200. /**
  1201. * Adds a new row to the grid
  1202. * @param height defines the height of the row (either in pixel or a value between 0 and 1)
  1203. * @param isPixel defines if the height is expressed in pixel (or in percentage)
  1204. * @returns the current grid
  1205. */
  1206. addRowDefinition(height: number, isPixel?: boolean): Grid;
  1207. /**
  1208. * Adds a new column to the grid
  1209. * @param width defines the width of the column (either in pixel or a value between 0 and 1)
  1210. * @param isPixel defines if the width is expressed in pixel (or in percentage)
  1211. * @returns the current grid
  1212. */
  1213. addColumnDefinition(width: number, isPixel?: boolean): Grid;
  1214. /**
  1215. * Update a row definition
  1216. * @param index defines the index of the row to update
  1217. * @param height defines the height of the row (either in pixel or a value between 0 and 1)
  1218. * @param isPixel defines if the weight is expressed in pixel (or in percentage)
  1219. * @returns the current grid
  1220. */
  1221. setRowDefinition(index: number, height: number, isPixel?: boolean): Grid;
  1222. /**
  1223. * Update a column definition
  1224. * @param index defines the index of the column to update
  1225. * @param width defines the width of the column (either in pixel or a value between 0 and 1)
  1226. * @param isPixel defines if the width is expressed in pixel (or in percentage)
  1227. * @returns the current grid
  1228. */
  1229. setColumnDefinition(index: number, width: number, isPixel?: boolean): Grid;
  1230. /**
  1231. * Remove a column definition at specified index
  1232. * @param index defines the index of the column to remove
  1233. * @returns the current grid
  1234. */
  1235. removeColumnDefinition(index: number): Grid;
  1236. /**
  1237. * Remove a row definition at specified index
  1238. * @param index defines the index of the row to remove
  1239. * @returns the current grid
  1240. */
  1241. removeRowDefinition(index: number): Grid;
  1242. /**
  1243. * Adds a new control to the current grid
  1244. * @param control defines the control to add
  1245. * @param row defines the row where to add the control (0 by default)
  1246. * @param column defines the column where to add the control (0 by default)
  1247. * @returns the current grid
  1248. */
  1249. addControl(control: Control, row?: number, column?: number): Grid;
  1250. /**
  1251. * Removes a control from the current container
  1252. * @param control defines the control to remove
  1253. * @returns the current container
  1254. */
  1255. removeControl(control: Control): Container;
  1256. /**
  1257. * Creates a new Grid
  1258. * @param name defines control name
  1259. */
  1260. constructor(name?: string | undefined);
  1261. protected _getTypeName(): string;
  1262. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1263. /** Releases associated resources */
  1264. dispose(): void;
  1265. }
  1266. }
  1267. declare module BABYLON.GUI {
  1268. /**
  1269. * Class used to create 2D images
  1270. */
  1271. class GUIImage extends Control {
  1272. name?: string | undefined;
  1273. /**
  1274. * Gets or sets the left coordinate in the source image
  1275. */
  1276. sourceLeft: number;
  1277. /**
  1278. * Gets or sets the top coordinate in the source image
  1279. */
  1280. sourceTop: number;
  1281. /**
  1282. * Gets or sets the width to capture in the source image
  1283. */
  1284. sourceWidth: number;
  1285. /**
  1286. * Gets or sets the height to capture in the source image
  1287. */
  1288. sourceHeight: number;
  1289. /**
  1290. * Gets or sets a boolean indicating if the image can force its container to adapt its size
  1291. * @see http://doc.babylonjs.com/how_to/gui#image
  1292. */
  1293. autoScale: boolean;
  1294. /** Gets or sets the streching mode used by the image */
  1295. stretch: number;
  1296. /**
  1297. * Gets or sets the internal DOM image used to render the control
  1298. */
  1299. domImage: HTMLImageElement;
  1300. /**
  1301. * Gets or sets image source url
  1302. */
  1303. source: BABYLON.Nullable<string>;
  1304. /**
  1305. * Gets or sets the cell width to use when animation sheet is enabled
  1306. * @see http://doc.babylonjs.com/how_to/gui#image
  1307. */
  1308. cellWidth: number;
  1309. /**
  1310. * Gets or sets the cell height to use when animation sheet is enabled
  1311. * @see http://doc.babylonjs.com/how_to/gui#image
  1312. */
  1313. cellHeight: number;
  1314. /**
  1315. * Gets or sets the cell id to use (this will turn on the animation sheet mode)
  1316. * @see http://doc.babylonjs.com/how_to/gui#image
  1317. */
  1318. cellId: number;
  1319. /**
  1320. * Creates a new Image
  1321. * @param name defines the control name
  1322. * @param url defines the image url
  1323. */
  1324. constructor(name?: string | undefined, url?: BABYLON.Nullable<string>);
  1325. protected _getTypeName(): string;
  1326. /** Force the control to synchronize with its content */
  1327. synchronizeSizeWithContent(): void;
  1328. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1329. /** STRETCH_NONE */
  1330. static readonly STRETCH_NONE: number;
  1331. /** STRETCH_FILL */
  1332. static readonly STRETCH_FILL: number;
  1333. /** STRETCH_UNIFORM */
  1334. static readonly STRETCH_UNIFORM: number;
  1335. /** STRETCH_EXTEND */
  1336. static readonly STRETCH_EXTEND: number;
  1337. }
  1338. }
  1339. declare module BABYLON.GUI {
  1340. /**
  1341. * Class used to create input text control
  1342. */
  1343. export class InputText extends Control implements IFocusableControl {
  1344. name?: string | undefined;
  1345. /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */
  1346. promptMessage: string;
  1347. /** BABYLON.Observable raised when the text changes */
  1348. onTextChangedObservable: BABYLON.Observable<InputText>;
  1349. /** BABYLON.Observable raised just before an entered character is to be added */
  1350. onBeforeKeyAddObservable: BABYLON.Observable<InputText>;
  1351. /** BABYLON.Observable raised when the control gets the focus */
  1352. onFocusObservable: BABYLON.Observable<InputText>;
  1353. /** BABYLON.Observable raised when the control loses the focus */
  1354. onBlurObservable: BABYLON.Observable<InputText>;
  1355. /** Gets or sets the maximum width allowed by the control */
  1356. maxWidth: string | number;
  1357. /** Gets the maximum width allowed by the control in pixels */
  1358. readonly maxWidthInPixels: number;
  1359. /** Gets or sets control margin */
  1360. margin: string;
  1361. /** Gets control margin in pixels */
  1362. readonly marginInPixels: number;
  1363. /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */
  1364. autoStretchWidth: boolean;
  1365. /** Gets or sets border thickness */
  1366. thickness: number;
  1367. /** Gets or sets the background color when focused */
  1368. focusedBackground: string;
  1369. /** Gets or sets the background color */
  1370. background: string;
  1371. /** Gets or sets the placeholder color */
  1372. placeholderColor: string;
  1373. /** Gets or sets the text displayed when the control is empty */
  1374. placeholderText: string;
  1375. /** Gets or sets the dead key flag */
  1376. deadKey: boolean;
  1377. /** Gets or sets if the current key should be added */
  1378. addKey: boolean;
  1379. /** Gets or sets the value of the current key being entered */
  1380. currentKey: string;
  1381. /** Gets or sets the text displayed in the control */
  1382. text: string;
  1383. /** Gets or sets control width */
  1384. width: string | number;
  1385. /**
  1386. * Creates a new InputText
  1387. * @param name defines the control name
  1388. * @param text defines the text of the control
  1389. */
  1390. constructor(name?: string | undefined, text?: string);
  1391. /** @hidden */
  1392. onBlur(): void;
  1393. /** @hidden */
  1394. onFocus(): void;
  1395. protected _getTypeName(): string;
  1396. /** @hidden */
  1397. processKey(keyCode: number, key?: string): void;
  1398. /** @hidden */
  1399. processKeyboard(evt: KeyboardEvent): void;
  1400. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1401. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1402. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  1403. protected _beforeRenderText(text: string): string;
  1404. dispose(): void;
  1405. }
  1406. }
  1407. declare module BABYLON.GUI {
  1408. /**
  1409. * Class used to create a password control
  1410. */
  1411. export class InputPassword extends InputText {
  1412. protected _beforeRenderText(text: string): string;
  1413. }
  1414. }
  1415. declare module BABYLON.GUI {
  1416. /** Class used to render 2D lines */
  1417. export class Line extends Control {
  1418. name?: string | undefined;
  1419. /** Gets or sets the dash pattern */
  1420. dash: Array<number>;
  1421. /** Gets or sets the control connected with the line end */
  1422. connectedControl: Control;
  1423. /** Gets or sets start coordinates on X axis */
  1424. x1: string | number;
  1425. /** Gets or sets start coordinates on Y axis */
  1426. y1: string | number;
  1427. /** Gets or sets end coordinates on X axis */
  1428. x2: string | number;
  1429. /** Gets or sets end coordinates on Y axis */
  1430. y2: string | number;
  1431. /** Gets or sets line width */
  1432. lineWidth: number;
  1433. /** Gets or sets horizontal alignment */
  1434. horizontalAlignment: number;
  1435. /** Gets or sets vertical alignment */
  1436. verticalAlignment: number;
  1437. /**
  1438. * Creates a new Line
  1439. * @param name defines the control name
  1440. */
  1441. constructor(name?: string | undefined);
  1442. protected _getTypeName(): string;
  1443. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1444. _measure(): void;
  1445. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1446. /**
  1447. * Move one end of the line given 3D cartesian coordinates.
  1448. * @param position Targeted world position
  1449. * @param scene BABYLON.Scene
  1450. * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
  1451. */
  1452. moveToVector3(position: BABYLON.Vector3, scene: BABYLON.Scene, end?: boolean): void;
  1453. /**
  1454. * Move one end of the line to a position in screen absolute space.
  1455. * @param projectedPosition Position in screen absolute space (X, Y)
  1456. * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
  1457. */
  1458. _moveToProjectedPosition(projectedPosition: BABYLON.Vector3, end?: boolean): void;
  1459. }
  1460. }
  1461. declare module BABYLON.GUI {
  1462. /**
  1463. * Class used to create multi line control
  1464. */
  1465. export class MultiLine extends Control {
  1466. name?: string | undefined;
  1467. /**
  1468. * Creates a new MultiLine
  1469. * @param name defines the control name
  1470. */
  1471. constructor(name?: string | undefined);
  1472. /** Gets or sets dash pattern */
  1473. dash: Array<number>;
  1474. /**
  1475. * Gets point stored at specified index
  1476. * @param index defines the index to look for
  1477. * @returns the requested point if found
  1478. */
  1479. getAt(index: number): MultiLinePoint;
  1480. /** Function called when a point is updated */
  1481. onPointUpdate: () => void;
  1482. /**
  1483. * Adds new points to the point collection
  1484. * @param items defines the list of items (mesh, control or 2d coordiantes) to add
  1485. * @returns the list of created MultiLinePoint
  1486. */
  1487. add(...items: (AbstractMesh | Control | {
  1488. x: string | number;
  1489. y: string | number;
  1490. })[]): MultiLinePoint[];
  1491. /**
  1492. * Adds a new point to the point collection
  1493. * @param item defines the item (mesh, control or 2d coordiantes) to add
  1494. * @returns the created MultiLinePoint
  1495. */
  1496. push(item?: (AbstractMesh | Control | {
  1497. x: string | number;
  1498. y: string | number;
  1499. })): MultiLinePoint;
  1500. /**
  1501. * Remove a specific value or point from the active point collection
  1502. * @param value defines the value or point to remove
  1503. */
  1504. remove(value: number | MultiLinePoint): void;
  1505. /** Gets or sets line width */
  1506. lineWidth: number;
  1507. horizontalAlignment: number;
  1508. verticalAlignment: number;
  1509. protected _getTypeName(): string;
  1510. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1511. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1512. _measure(): void;
  1513. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1514. dispose(): void;
  1515. }
  1516. }
  1517. declare module BABYLON.GUI {
  1518. /**
  1519. * Class used to create radio button controls
  1520. */
  1521. export class RadioButton extends Control {
  1522. name?: string | undefined;
  1523. /** Gets or sets border thickness */
  1524. thickness: number;
  1525. /** Gets or sets group name */
  1526. group: string;
  1527. /** BABYLON.Observable raised when isChecked is changed */
  1528. onIsCheckedChangedObservable: BABYLON.Observable<boolean>;
  1529. /** Gets or sets a value indicating the ratio between overall size and check size */
  1530. checkSizeRatio: number;
  1531. /** Gets or sets background color */
  1532. background: string;
  1533. /** Gets or sets a boolean indicating if the checkbox is checked or not */
  1534. isChecked: boolean;
  1535. /**
  1536. * Creates a new RadioButton
  1537. * @param name defines the control name
  1538. */
  1539. constructor(name?: string | undefined);
  1540. protected _getTypeName(): string;
  1541. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1542. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1543. }
  1544. }
  1545. declare module BABYLON.GUI {
  1546. /**
  1547. * Class used to create a 2D stack panel container
  1548. */
  1549. export class StackPanel extends Container {
  1550. name?: string | undefined;
  1551. /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
  1552. isVertical: boolean;
  1553. /** Gets or sets panel width */
  1554. width: string | number;
  1555. /** Gets or sets panel height */
  1556. height: string | number;
  1557. /**
  1558. * Creates a new StackPanel
  1559. * @param name defines control name
  1560. */
  1561. constructor(name?: string | undefined);
  1562. protected _getTypeName(): string;
  1563. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1564. }
  1565. }
  1566. declare module BABYLON.GUI {
  1567. /**
  1568. * Enum that determines the text-wrapping mode to use.
  1569. */
  1570. export enum TextWrapping {
  1571. /**
  1572. * Clip the text when it's larger than Control.width; this is the default mode.
  1573. */
  1574. Clip = 0,
  1575. /**
  1576. * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.
  1577. */
  1578. WordWrap = 1,
  1579. /**
  1580. * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.
  1581. */
  1582. Ellipsis = 2
  1583. }
  1584. /**
  1585. * Class used to create text block control
  1586. */
  1587. export class TextBlock extends Control {
  1588. /**
  1589. * Defines the name of the control
  1590. */
  1591. name?: string | undefined;
  1592. /**
  1593. * An event triggered after the text is changed
  1594. */
  1595. onTextChangedObservable: BABYLON.Observable<TextBlock>;
  1596. /**
  1597. * An event triggered after the text was broken up into lines
  1598. */
  1599. onLinesReadyObservable: BABYLON.Observable<TextBlock>;
  1600. /**
  1601. * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
  1602. */
  1603. readonly lines: any[];
  1604. /**
  1605. * Gets or sets an boolean indicating that the TextBlock will be resized to fit container
  1606. */
  1607. resizeToFit: boolean;
  1608. /**
  1609. * Gets or sets a boolean indicating if text must be wrapped
  1610. */
  1611. textWrapping: TextWrapping | boolean;
  1612. /**
  1613. * Gets or sets text to display
  1614. */
  1615. text: string;
  1616. /**
  1617. * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
  1618. */
  1619. textHorizontalAlignment: number;
  1620. /**
  1621. * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
  1622. */
  1623. textVerticalAlignment: number;
  1624. /**
  1625. * Gets or sets line spacing value
  1626. */
  1627. lineSpacing: string | number;
  1628. /**
  1629. * Gets or sets outlineWidth of the text to display
  1630. */
  1631. outlineWidth: number;
  1632. /**
  1633. * Gets or sets outlineColor of the text to display
  1634. */
  1635. outlineColor: string;
  1636. /**
  1637. * Creates a new TextBlock object
  1638. * @param name defines the name of the control
  1639. * @param text defines the text to display (emptry string by default)
  1640. */
  1641. constructor(
  1642. /**
  1643. * Defines the name of the control
  1644. */
  1645. name?: string | undefined, text?: string);
  1646. protected _getTypeName(): string;
  1647. /** @hidden */
  1648. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1649. protected _applyStates(context: CanvasRenderingContext2D): void;
  1650. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1651. protected _breakLines(refWidth: number, context: CanvasRenderingContext2D): object[];
  1652. protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
  1653. protected _parseLineEllipsis(line: string | undefined, width: number, context: CanvasRenderingContext2D): object;
  1654. protected _parseLineWordWrap(line: string | undefined, width: number, context: CanvasRenderingContext2D): object[];
  1655. protected _renderLines(context: CanvasRenderingContext2D): void;
  1656. /**
  1657. * Given a width constraint applied on the text block, find the expected height
  1658. * @returns expected height
  1659. */
  1660. computeExpectedHeight(): number;
  1661. dispose(): void;
  1662. }
  1663. }
  1664. declare module BABYLON.GUI {
  1665. /**
  1666. * Class used to store key control properties
  1667. */
  1668. export class KeyPropertySet {
  1669. /** Width */
  1670. width?: string;
  1671. /** Height */
  1672. height?: string;
  1673. /** Left padding */
  1674. paddingLeft?: string;
  1675. /** Right padding */
  1676. paddingRight?: string;
  1677. /** Top padding */
  1678. paddingTop?: string;
  1679. /** Bottom padding */
  1680. paddingBottom?: string;
  1681. /** Foreground color */
  1682. color?: string;
  1683. /** Background color */
  1684. background?: string;
  1685. }
  1686. /**
  1687. * Class used to create virtual keyboard
  1688. */
  1689. export class VirtualKeyboard extends StackPanel {
  1690. /** BABYLON.Observable raised when a key is pressed */
  1691. onKeyPressObservable: BABYLON.Observable<string>;
  1692. /** Gets or sets default key button width */
  1693. defaultButtonWidth: string;
  1694. /** Gets or sets default key button height */
  1695. defaultButtonHeight: string;
  1696. /** Gets or sets default key button left padding */
  1697. defaultButtonPaddingLeft: string;
  1698. /** Gets or sets default key button right padding */
  1699. defaultButtonPaddingRight: string;
  1700. /** Gets or sets default key button top padding */
  1701. defaultButtonPaddingTop: string;
  1702. /** Gets or sets default key button bottom padding */
  1703. defaultButtonPaddingBottom: string;
  1704. /** Gets or sets default key button foreground color */
  1705. defaultButtonColor: string;
  1706. /** Gets or sets default key button background color */
  1707. defaultButtonBackground: string;
  1708. /** Gets or sets shift button foreground color */
  1709. shiftButtonColor: string;
  1710. /** Gets or sets shift button thickness*/
  1711. selectedShiftThickness: number;
  1712. /** Gets shift key state */
  1713. shiftState: number;
  1714. protected _getTypeName(): string;
  1715. /**
  1716. * Adds a new row of keys
  1717. * @param keys defines the list of keys to add
  1718. * @param propertySets defines the associated property sets
  1719. */
  1720. addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
  1721. /**
  1722. * Set the shift key to a specific state
  1723. * @param shiftState defines the new shift state
  1724. */
  1725. applyShiftState(shiftState: number): void;
  1726. /** Gets the input text control attached with the keyboard */
  1727. readonly connectedInputText: BABYLON.Nullable<InputText>;
  1728. /**
  1729. * Connects the keyboard with an input text control
  1730. * @param input defines the target control
  1731. */
  1732. connect(input: InputText): void;
  1733. /**
  1734. * Disconnects the keyboard from an input text control
  1735. */
  1736. disconnect(): void;
  1737. /**
  1738. * Creates a new keyboard using a default layout
  1739. * @returns a new VirtualKeyboard
  1740. */
  1741. static CreateDefaultLayout(): VirtualKeyboard;
  1742. }
  1743. }
  1744. declare module BABYLON.GUI {
  1745. /**
  1746. * Class used to create slider controls
  1747. */
  1748. export class Slider extends Control {
  1749. name?: string | undefined;
  1750. /** BABYLON.Observable raised when the sldier value changes */
  1751. onValueChangedObservable: BABYLON.Observable<number>;
  1752. /** Gets or sets border color */
  1753. borderColor: string;
  1754. /** Gets or sets background color */
  1755. background: string;
  1756. /** Gets or sets main bar offset */
  1757. barOffset: string | number;
  1758. /** Gets main bar offset in pixels*/
  1759. readonly barOffsetInPixels: number;
  1760. /** Gets or sets thumb width */
  1761. thumbWidth: string | number;
  1762. /** Gets thumb width in pixels */
  1763. readonly thumbWidthInPixels: number;
  1764. /** Gets or sets minimum value */
  1765. minimum: number;
  1766. /** Gets or sets maximum value */
  1767. maximum: number;
  1768. /** Gets or sets current value */
  1769. value: number;
  1770. /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */
  1771. isVertical: boolean;
  1772. /** Gets or sets a boolean indicating if the thumb should be round or square */
  1773. isThumbCircle: boolean;
  1774. /** Gets or sets a value indicating if the thumb can go over main bar extends */
  1775. isThumbClamped: boolean;
  1776. /**
  1777. * Creates a new Slider
  1778. * @param name defines the control name
  1779. */
  1780. constructor(name?: string | undefined);
  1781. protected _getTypeName(): string;
  1782. protected _getThumbThickness(type: string, backgroundLength: number): number;
  1783. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1784. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1785. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  1786. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  1787. }
  1788. }
  1789. declare module BABYLON.GUI {
  1790. /** Class used to create rectangle container */
  1791. export class Rectangle extends Container {
  1792. name?: string | undefined;
  1793. /** Gets or sets border thickness */
  1794. thickness: number;
  1795. /** Gets or sets the corner radius angle */
  1796. cornerRadius: number;
  1797. /**
  1798. * Creates a new Rectangle
  1799. * @param name defines the control name
  1800. */
  1801. constructor(name?: string | undefined);
  1802. protected _getTypeName(): string;
  1803. protected _localDraw(context: CanvasRenderingContext2D): void;
  1804. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1805. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  1806. }
  1807. }
  1808. declare module BABYLON.GUI {
  1809. /**
  1810. * Forcing an export so that this code will execute
  1811. * @hidden
  1812. */
  1813. const name = "Statics";
  1814. }
  1815. declare module BABYLON.GUI {
  1816. /**
  1817. * Class used as a root to all buttons
  1818. */
  1819. export class AbstractButton3D extends Control3D {
  1820. /**
  1821. * Creates a new button
  1822. * @param name defines the control name
  1823. */
  1824. constructor(name?: string);
  1825. protected _getTypeName(): string;
  1826. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  1827. }
  1828. }
  1829. declare module BABYLON.GUI {
  1830. /**
  1831. * Class used to create a button in 3D
  1832. */
  1833. export class Button3D extends AbstractButton3D {
  1834. /** @hidden */
  1835. protected _currentMaterial: BABYLON.Material;
  1836. /**
  1837. * Gets or sets the texture resolution used to render content (512 by default)
  1838. */
  1839. contentResolution: BABYLON.int;
  1840. /**
  1841. * Gets or sets the texture scale ratio used to render content (2 by default)
  1842. */
  1843. contentScaleRatio: number;
  1844. protected _disposeFacadeTexture(): void;
  1845. protected _resetContent(): void;
  1846. /**
  1847. * Creates a new button
  1848. * @param name defines the control name
  1849. */
  1850. constructor(name?: string);
  1851. /**
  1852. * Gets or sets the GUI 2D content used to display the button's facade
  1853. */
  1854. content: Control;
  1855. /**
  1856. * Apply the facade texture (created from the content property).
  1857. * This function can be overloaded by child classes
  1858. * @param facadeTexture defines the AdvancedDynamicTexture to use
  1859. */
  1860. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  1861. protected _getTypeName(): string;
  1862. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  1863. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  1864. /**
  1865. * Releases all associated resources
  1866. */
  1867. dispose(): void;
  1868. }
  1869. }
  1870. declare module BABYLON.GUI {
  1871. /**
  1872. * Class used to create containers for controls
  1873. */
  1874. export class Container3D extends Control3D {
  1875. /**
  1876. * Gets the list of child controls
  1877. */
  1878. protected _children: Control3D[];
  1879. /**
  1880. * Gets the list of child controls
  1881. */
  1882. readonly children: Array<Control3D>;
  1883. /**
  1884. * Gets or sets a boolean indicating if the layout must be blocked (default is false).
  1885. * This is helpful to optimize layout operation when adding multiple children in a row
  1886. */
  1887. blockLayout: boolean;
  1888. /**
  1889. * Creates a new container
  1890. * @param name defines the container name
  1891. */
  1892. constructor(name?: string);
  1893. /**
  1894. * Force the container to update the layout. Please note that it will not take blockLayout property in account
  1895. * @returns the current container
  1896. */
  1897. updateLayout(): Container3D;
  1898. /**
  1899. * Gets a boolean indicating if the given control is in the children of this control
  1900. * @param control defines the control to check
  1901. * @returns true if the control is in the child list
  1902. */
  1903. containsControl(control: Control3D): boolean;
  1904. /**
  1905. * Adds a control to the children of this control
  1906. * @param control defines the control to add
  1907. * @returns the current container
  1908. */
  1909. addControl(control: Control3D): Container3D;
  1910. /**
  1911. * This function will be called everytime a new control is added
  1912. */
  1913. protected _arrangeChildren(): void;
  1914. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  1915. /**
  1916. * Removes a control from the children of this control
  1917. * @param control defines the control to remove
  1918. * @returns the current container
  1919. */
  1920. removeControl(control: Control3D): Container3D;
  1921. protected _getTypeName(): string;
  1922. /**
  1923. * Releases all associated resources
  1924. */
  1925. dispose(): void;
  1926. /** Control rotation will remain unchanged */
  1927. static readonly UNSET_ORIENTATION: number;
  1928. /** Control will rotate to make it look at sphere central axis */
  1929. static readonly FACEORIGIN_ORIENTATION: number;
  1930. /** Control will rotate to make it look back at sphere central axis */
  1931. static readonly FACEORIGINREVERSED_ORIENTATION: number;
  1932. /** Control will rotate to look at z axis (0, 0, 1) */
  1933. static readonly FACEFORWARD_ORIENTATION: number;
  1934. /** Control will rotate to look at negative z axis (0, 0, -1) */
  1935. static readonly FACEFORWARDREVERSED_ORIENTATION: number;
  1936. }
  1937. }
  1938. declare module BABYLON.GUI {
  1939. /**
  1940. * Class used as base class for controls
  1941. */
  1942. export class Control3D implements BABYLON.IDisposable, BABYLON.IBehaviorAware<Control3D> {
  1943. /** Defines the control name */
  1944. name?: string | undefined;
  1945. /** @hidden */
  1946. _host: GUI3DManager;
  1947. /** Gets or sets the control position in world space */
  1948. position: BABYLON.Vector3;
  1949. /** Gets or sets the control scaling in world space */
  1950. scaling: BABYLON.Vector3;
  1951. /** Callback used to start pointer enter animation */
  1952. pointerEnterAnimation: () => void;
  1953. /** Callback used to start pointer out animation */
  1954. pointerOutAnimation: () => void;
  1955. /** Callback used to start pointer down animation */
  1956. pointerDownAnimation: () => void;
  1957. /** Callback used to start pointer up animation */
  1958. pointerUpAnimation: () => void;
  1959. /**
  1960. * An event triggered when the pointer move over the control
  1961. */
  1962. onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector3>;
  1963. /**
  1964. * An event triggered when the pointer move out of the control
  1965. */
  1966. onPointerOutObservable: BABYLON.Observable<Control3D>;
  1967. /**
  1968. * An event triggered when the pointer taps the control
  1969. */
  1970. onPointerDownObservable: BABYLON.Observable<Vector3WithInfo>;
  1971. /**
  1972. * An event triggered when pointer is up
  1973. */
  1974. onPointerUpObservable: BABYLON.Observable<Vector3WithInfo>;
  1975. /**
  1976. * An event triggered when a control is clicked on (with a mouse)
  1977. */
  1978. onPointerClickObservable: BABYLON.Observable<Vector3WithInfo>;
  1979. /**
  1980. * An event triggered when pointer enters the control
  1981. */
  1982. onPointerEnterObservable: BABYLON.Observable<Control3D>;
  1983. /**
  1984. * Gets or sets the parent container
  1985. */
  1986. parent: BABYLON.Nullable<Container3D>;
  1987. /**
  1988. * Gets the list of attached behaviors
  1989. * @see http://doc.babylonjs.com/features/behaviour
  1990. */
  1991. readonly behaviors: BABYLON.Behavior<Control3D>[];
  1992. /**
  1993. * Attach a behavior to the control
  1994. * @see http://doc.babylonjs.com/features/behaviour
  1995. * @param behavior defines the behavior to attach
  1996. * @returns the current control
  1997. */
  1998. addBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  1999. /**
  2000. * Remove an attached behavior
  2001. * @see http://doc.babylonjs.com/features/behaviour
  2002. * @param behavior defines the behavior to attach
  2003. * @returns the current control
  2004. */
  2005. removeBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  2006. /**
  2007. * Gets an attached behavior by name
  2008. * @param name defines the name of the behavior to look for
  2009. * @see http://doc.babylonjs.com/features/behaviour
  2010. * @returns null if behavior was not found else the requested behavior
  2011. */
  2012. getBehaviorByName(name: string): BABYLON.Nullable<BABYLON.Behavior<Control3D>>;
  2013. /** Gets or sets a boolean indicating if the control is visible */
  2014. isVisible: boolean;
  2015. /**
  2016. * Creates a new control
  2017. * @param name defines the control name
  2018. */
  2019. constructor(
  2020. /** Defines the control name */
  2021. name?: string | undefined);
  2022. /**
  2023. * Gets a string representing the class name
  2024. */
  2025. readonly typeName: string;
  2026. protected _getTypeName(): string;
  2027. /**
  2028. * Gets the transform node used by this control
  2029. */
  2030. readonly node: BABYLON.Nullable<BABYLON.TransformNode>;
  2031. /**
  2032. * Gets the mesh used to render this control
  2033. */
  2034. readonly mesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  2035. /**
  2036. * Link the control as child of the given node
  2037. * @param node defines the node to link to. Use null to unlink the control
  2038. * @returns the current control
  2039. */
  2040. linkToTransformNode(node: BABYLON.Nullable<BABYLON.TransformNode>): Control3D;
  2041. /** @hidden **/
  2042. _prepareNode(scene: BABYLON.Scene): void;
  2043. /**
  2044. * Node creation.
  2045. * Can be overriden by children
  2046. * @param scene defines the scene where the node must be attached
  2047. * @returns the attached node or null if none. Must return a BABYLON.Mesh or BABYLON.AbstractMesh if there is an atttached visible object
  2048. */
  2049. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  2050. /**
  2051. * Affect a material to the given mesh
  2052. * @param mesh defines the mesh which will represent the control
  2053. */
  2054. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2055. /** @hidden */
  2056. _onPointerMove(target: Control3D, coordinates: BABYLON.Vector3): void;
  2057. /** @hidden */
  2058. _onPointerEnter(target: Control3D): boolean;
  2059. /** @hidden */
  2060. _onPointerOut(target: Control3D): void;
  2061. /** @hidden */
  2062. _onPointerDown(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2063. /** @hidden */
  2064. _onPointerUp(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  2065. /** @hidden */
  2066. forcePointerUp(pointerId?: BABYLON.Nullable<number>): void;
  2067. /** @hidden */
  2068. _processObservables(type: number, pickedPoint: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2069. /** @hidden */
  2070. _disposeNode(): void;
  2071. /**
  2072. * Releases all associated resources
  2073. */
  2074. dispose(): void;
  2075. }
  2076. }
  2077. declare module BABYLON.GUI {
  2078. /**
  2079. * Class used to create a container panel deployed on the surface of a cylinder
  2080. */
  2081. export class CylinderPanel extends VolumeBasedPanel {
  2082. /**
  2083. * Gets or sets the radius of the cylinder where to project controls (5 by default)
  2084. */
  2085. radius: BABYLON.float;
  2086. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2087. }
  2088. }
  2089. declare module BABYLON.GUI {
  2090. /**
  2091. * Class used to create a holographic button in 3D
  2092. */
  2093. export class HolographicButton extends Button3D {
  2094. /**
  2095. * Gets or sets text for the button
  2096. */
  2097. text: string;
  2098. /**
  2099. * Gets or sets the image url for the button
  2100. */
  2101. imageUrl: string;
  2102. /**
  2103. * Gets the back material used by this button
  2104. */
  2105. readonly backMaterial: FluentMaterial;
  2106. /**
  2107. * Gets the front material used by this button
  2108. */
  2109. readonly frontMaterial: FluentMaterial;
  2110. /**
  2111. * Gets the plate material used by this button
  2112. */
  2113. readonly plateMaterial: BABYLON.StandardMaterial;
  2114. /**
  2115. * Gets a boolean indicating if this button shares its material with other HolographicButtons
  2116. */
  2117. readonly shareMaterials: boolean;
  2118. /**
  2119. * Creates a new button
  2120. * @param name defines the control name
  2121. */
  2122. constructor(name?: string, shareMaterials?: boolean);
  2123. protected _getTypeName(): string;
  2124. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2125. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  2126. protected _affectMaterial(mesh: BABYLON.Mesh): void;
  2127. /**
  2128. * Releases all associated resources
  2129. */
  2130. dispose(): void;
  2131. }
  2132. }
  2133. declare module BABYLON.GUI {
  2134. /**
  2135. * Class used to create an interactable object. It's a 3D button using a mesh coming from the current scene
  2136. */
  2137. export class MeshButton3D extends Button3D {
  2138. /** @hidden */
  2139. protected _currentMesh: BABYLON.Mesh;
  2140. /**
  2141. * Creates a new 3D button based on a mesh
  2142. * @param mesh mesh to become a 3D button
  2143. * @param name defines the control name
  2144. */
  2145. constructor(mesh: BABYLON.Mesh, name?: string);
  2146. protected _getTypeName(): string;
  2147. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2148. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2149. }
  2150. }
  2151. declare module BABYLON.GUI {
  2152. /**
  2153. * Class used to create a container panel deployed on the surface of a plane
  2154. */
  2155. export class PlanePanel extends VolumeBasedPanel {
  2156. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2157. }
  2158. }
  2159. declare module BABYLON.GUI {
  2160. /**
  2161. * Class used to create a container panel where items get randomized planar mapping
  2162. */
  2163. export class ScatterPanel extends VolumeBasedPanel {
  2164. /**
  2165. * Gets or sets the number of iteration to use to scatter the controls (100 by default)
  2166. */
  2167. iteration: BABYLON.float;
  2168. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2169. protected _finalProcessing(): void;
  2170. }
  2171. }
  2172. declare module BABYLON.GUI {
  2173. /**
  2174. * Class used to create a container panel deployed on the surface of a sphere
  2175. */
  2176. export class SpherePanel extends VolumeBasedPanel {
  2177. /**
  2178. * Gets or sets the radius of the sphere where to project controls (5 by default)
  2179. */
  2180. radius: BABYLON.float;
  2181. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2182. }
  2183. }
  2184. declare module BABYLON.GUI {
  2185. /**
  2186. * Class used to create a stack panel in 3D on XY plane
  2187. */
  2188. export class StackPanel3D extends Container3D {
  2189. /**
  2190. * Gets or sets a boolean indicating if the stack panel is vertical or horizontal (horizontal by default)
  2191. */
  2192. isVertical: boolean;
  2193. /**
  2194. * Gets or sets the distance between elements
  2195. */
  2196. margin: number;
  2197. /**
  2198. * Creates new StackPanel
  2199. * @param isVertical
  2200. */
  2201. constructor(isVertical?: boolean);
  2202. protected _arrangeChildren(): void;
  2203. }
  2204. }
  2205. declare module BABYLON.GUI {
  2206. /**
  2207. * Abstract class used to create a container panel deployed on the surface of a volume
  2208. */
  2209. export abstract class VolumeBasedPanel extends Container3D {
  2210. protected _cellWidth: number;
  2211. protected _cellHeight: number;
  2212. /**
  2213. * Gets or sets the distance between elements
  2214. */
  2215. margin: number;
  2216. /**
  2217. * Gets or sets the orientation to apply to all controls (BABYLON.Container3D.FaceOriginReversedOrientation by default)
  2218. * | Value | Type | Description |
  2219. * | ----- | ----------------------------------- | ----------- |
  2220. * | 0 | UNSET_ORIENTATION | Control rotation will remain unchanged |
  2221. * | 1 | FACEORIGIN_ORIENTATION | Control will rotate to make it look at sphere central axis |
  2222. * | 2 | FACEORIGINREVERSED_ORIENTATION | Control will rotate to make it look back at sphere central axis |
  2223. * | 3 | FACEFORWARD_ORIENTATION | Control will rotate to look at z axis (0, 0, 1) |
  2224. * | 4 | FACEFORWARDREVERSED_ORIENTATION | Control will rotate to look at negative z axis (0, 0, -1) |
  2225. */
  2226. orientation: number;
  2227. /**
  2228. * Gets or sets the number of columns requested (10 by default).
  2229. * The panel will automatically compute the number of rows based on number of child controls.
  2230. */
  2231. columns: BABYLON.int;
  2232. /**
  2233. * Gets or sets a the number of rows requested.
  2234. * The panel will automatically compute the number of columns based on number of child controls.
  2235. */
  2236. rows: BABYLON.int;
  2237. /**
  2238. * Creates new VolumeBasedPanel
  2239. */
  2240. constructor();
  2241. protected _arrangeChildren(): void;
  2242. /** Child classes must implement this function to provide correct control positioning */
  2243. protected abstract _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2244. /** Child classes can implement this function to provide additional processing */
  2245. protected _finalProcessing(): void;
  2246. }
  2247. }
  2248. declare module BABYLON.GUI {
  2249. /** @hidden */
  2250. export class FluentMaterialDefines extends BABYLON.MaterialDefines {
  2251. INNERGLOW: boolean;
  2252. BORDER: boolean;
  2253. HOVERLIGHT: boolean;
  2254. constructor();
  2255. }
  2256. /**
  2257. * Class used to render controls with fluent desgin
  2258. */
  2259. export class FluentMaterial extends BABYLON.PushMaterial {
  2260. /**
  2261. * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
  2262. */
  2263. innerGlowColorIntensity: number;
  2264. /**
  2265. * Gets or sets the inner glow color (white by default)
  2266. */
  2267. innerGlowColor: BABYLON.Color3;
  2268. /**
  2269. * Gets or sets alpha value (default is 1.0)
  2270. */
  2271. alpha: number;
  2272. /**
  2273. * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
  2274. */
  2275. albedoColor: BABYLON.Color3;
  2276. /**
  2277. * Gets or sets a boolean indicating if borders must be rendered (default is false)
  2278. */
  2279. renderBorders: boolean;
  2280. /**
  2281. * Gets or sets border width (default is 0.5)
  2282. */
  2283. borderWidth: number;
  2284. /**
  2285. * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
  2286. */
  2287. edgeSmoothingValue: number;
  2288. /**
  2289. * Gets or sets the minimum value that can be applied to border width (default is 0.1)
  2290. */
  2291. borderMinValue: number;
  2292. /**
  2293. * Gets or sets a boolean indicating if hover light must be rendered (default is false)
  2294. */
  2295. renderHoverLight: boolean;
  2296. /**
  2297. * Gets or sets the radius used to render the hover light (default is 0.15)
  2298. */
  2299. hoverRadius: number;
  2300. /**
  2301. * Gets or sets the color used to render the hover light (default is BABYLON.Color4(0.3, 0.3, 0.3, 1.0))
  2302. */
  2303. hoverColor: BABYLON.Color4;
  2304. /**
  2305. * Gets or sets the hover light position in world space (default is BABYLON.Vector3.Zero())
  2306. */
  2307. hoverPosition: BABYLON.Vector3;
  2308. /**
  2309. * Creates a new Fluent material
  2310. * @param name defines the name of the material
  2311. * @param scene defines the hosting scene
  2312. */
  2313. constructor(name: string, scene: BABYLON.Scene);
  2314. needAlphaBlending(): boolean;
  2315. needAlphaTesting(): boolean;
  2316. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  2317. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  2318. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  2319. getActiveTextures(): BABYLON.BaseTexture[];
  2320. hasTexture(texture: BABYLON.BaseTexture): boolean;
  2321. dispose(forceDisposeEffect?: boolean): void;
  2322. clone(name: string): FluentMaterial;
  2323. serialize(): any;
  2324. getClassName(): string;
  2325. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
  2326. }
  2327. }