babylon.gui.d.ts 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356
  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. /** Class used to render a grid */
  1810. export class DisplayGrid extends Control {
  1811. name?: string | undefined;
  1812. /** Gets or sets background color (Black by default) */
  1813. background: string;
  1814. /** Gets or sets the width of each cell (20 by default) */
  1815. cellWidth: number;
  1816. /** Gets or sets the height of each cell (20 by default) */
  1817. cellHeight: number;
  1818. /** Gets or sets the tickness of minor lines (1 by default) */
  1819. minorLineTickness: number;
  1820. /** Gets or sets the color of minor lines (DarkGray by default) */
  1821. minorLineColor: string;
  1822. /** Gets or sets the tickness of major lines (2 by default) */
  1823. majorLineTickness: number;
  1824. /** Gets or sets the color of major lines (White by default) */
  1825. majorLineColor: string;
  1826. /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/
  1827. majorLineFrequency: number;
  1828. /**
  1829. * Creates a new GridDisplayRectangle
  1830. * @param name defines the control name
  1831. */
  1832. constructor(name?: string | undefined);
  1833. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1834. protected _getTypeName(): string;
  1835. }
  1836. }
  1837. declare module BABYLON.GUI {
  1838. /**
  1839. * Forcing an export so that this code will execute
  1840. * @hidden
  1841. */
  1842. const name = "Statics";
  1843. }
  1844. declare module BABYLON.GUI {
  1845. /**
  1846. * Class used as a root to all buttons
  1847. */
  1848. export class AbstractButton3D extends Control3D {
  1849. /**
  1850. * Creates a new button
  1851. * @param name defines the control name
  1852. */
  1853. constructor(name?: string);
  1854. protected _getTypeName(): string;
  1855. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  1856. }
  1857. }
  1858. declare module BABYLON.GUI {
  1859. /**
  1860. * Class used to create a button in 3D
  1861. */
  1862. export class Button3D extends AbstractButton3D {
  1863. /** @hidden */
  1864. protected _currentMaterial: BABYLON.Material;
  1865. /**
  1866. * Gets or sets the texture resolution used to render content (512 by default)
  1867. */
  1868. contentResolution: BABYLON.int;
  1869. /**
  1870. * Gets or sets the texture scale ratio used to render content (2 by default)
  1871. */
  1872. contentScaleRatio: number;
  1873. protected _disposeFacadeTexture(): void;
  1874. protected _resetContent(): void;
  1875. /**
  1876. * Creates a new button
  1877. * @param name defines the control name
  1878. */
  1879. constructor(name?: string);
  1880. /**
  1881. * Gets or sets the GUI 2D content used to display the button's facade
  1882. */
  1883. content: Control;
  1884. /**
  1885. * Apply the facade texture (created from the content property).
  1886. * This function can be overloaded by child classes
  1887. * @param facadeTexture defines the AdvancedDynamicTexture to use
  1888. */
  1889. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  1890. protected _getTypeName(): string;
  1891. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  1892. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  1893. /**
  1894. * Releases all associated resources
  1895. */
  1896. dispose(): void;
  1897. }
  1898. }
  1899. declare module BABYLON.GUI {
  1900. /**
  1901. * Class used to create containers for controls
  1902. */
  1903. export class Container3D extends Control3D {
  1904. /**
  1905. * Gets the list of child controls
  1906. */
  1907. protected _children: Control3D[];
  1908. /**
  1909. * Gets the list of child controls
  1910. */
  1911. readonly children: Array<Control3D>;
  1912. /**
  1913. * Gets or sets a boolean indicating if the layout must be blocked (default is false).
  1914. * This is helpful to optimize layout operation when adding multiple children in a row
  1915. */
  1916. blockLayout: boolean;
  1917. /**
  1918. * Creates a new container
  1919. * @param name defines the container name
  1920. */
  1921. constructor(name?: string);
  1922. /**
  1923. * Force the container to update the layout. Please note that it will not take blockLayout property in account
  1924. * @returns the current container
  1925. */
  1926. updateLayout(): Container3D;
  1927. /**
  1928. * Gets a boolean indicating if the given control is in the children of this control
  1929. * @param control defines the control to check
  1930. * @returns true if the control is in the child list
  1931. */
  1932. containsControl(control: Control3D): boolean;
  1933. /**
  1934. * Adds a control to the children of this control
  1935. * @param control defines the control to add
  1936. * @returns the current container
  1937. */
  1938. addControl(control: Control3D): Container3D;
  1939. /**
  1940. * This function will be called everytime a new control is added
  1941. */
  1942. protected _arrangeChildren(): void;
  1943. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  1944. /**
  1945. * Removes a control from the children of this control
  1946. * @param control defines the control to remove
  1947. * @returns the current container
  1948. */
  1949. removeControl(control: Control3D): Container3D;
  1950. protected _getTypeName(): string;
  1951. /**
  1952. * Releases all associated resources
  1953. */
  1954. dispose(): void;
  1955. /** Control rotation will remain unchanged */
  1956. static readonly UNSET_ORIENTATION: number;
  1957. /** Control will rotate to make it look at sphere central axis */
  1958. static readonly FACEORIGIN_ORIENTATION: number;
  1959. /** Control will rotate to make it look back at sphere central axis */
  1960. static readonly FACEORIGINREVERSED_ORIENTATION: number;
  1961. /** Control will rotate to look at z axis (0, 0, 1) */
  1962. static readonly FACEFORWARD_ORIENTATION: number;
  1963. /** Control will rotate to look at negative z axis (0, 0, -1) */
  1964. static readonly FACEFORWARDREVERSED_ORIENTATION: number;
  1965. }
  1966. }
  1967. declare module BABYLON.GUI {
  1968. /**
  1969. * Class used as base class for controls
  1970. */
  1971. export class Control3D implements BABYLON.IDisposable, BABYLON.IBehaviorAware<Control3D> {
  1972. /** Defines the control name */
  1973. name?: string | undefined;
  1974. /** @hidden */
  1975. _host: GUI3DManager;
  1976. /** Gets or sets the control position in world space */
  1977. position: BABYLON.Vector3;
  1978. /** Gets or sets the control scaling in world space */
  1979. scaling: BABYLON.Vector3;
  1980. /** Callback used to start pointer enter animation */
  1981. pointerEnterAnimation: () => void;
  1982. /** Callback used to start pointer out animation */
  1983. pointerOutAnimation: () => void;
  1984. /** Callback used to start pointer down animation */
  1985. pointerDownAnimation: () => void;
  1986. /** Callback used to start pointer up animation */
  1987. pointerUpAnimation: () => void;
  1988. /**
  1989. * An event triggered when the pointer move over the control
  1990. */
  1991. onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector3>;
  1992. /**
  1993. * An event triggered when the pointer move out of the control
  1994. */
  1995. onPointerOutObservable: BABYLON.Observable<Control3D>;
  1996. /**
  1997. * An event triggered when the pointer taps the control
  1998. */
  1999. onPointerDownObservable: BABYLON.Observable<Vector3WithInfo>;
  2000. /**
  2001. * An event triggered when pointer is up
  2002. */
  2003. onPointerUpObservable: BABYLON.Observable<Vector3WithInfo>;
  2004. /**
  2005. * An event triggered when a control is clicked on (with a mouse)
  2006. */
  2007. onPointerClickObservable: BABYLON.Observable<Vector3WithInfo>;
  2008. /**
  2009. * An event triggered when pointer enters the control
  2010. */
  2011. onPointerEnterObservable: BABYLON.Observable<Control3D>;
  2012. /**
  2013. * Gets or sets the parent container
  2014. */
  2015. parent: BABYLON.Nullable<Container3D>;
  2016. /**
  2017. * Gets the list of attached behaviors
  2018. * @see http://doc.babylonjs.com/features/behaviour
  2019. */
  2020. readonly behaviors: BABYLON.Behavior<Control3D>[];
  2021. /**
  2022. * Attach a behavior to the control
  2023. * @see http://doc.babylonjs.com/features/behaviour
  2024. * @param behavior defines the behavior to attach
  2025. * @returns the current control
  2026. */
  2027. addBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  2028. /**
  2029. * Remove an attached behavior
  2030. * @see http://doc.babylonjs.com/features/behaviour
  2031. * @param behavior defines the behavior to attach
  2032. * @returns the current control
  2033. */
  2034. removeBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  2035. /**
  2036. * Gets an attached behavior by name
  2037. * @param name defines the name of the behavior to look for
  2038. * @see http://doc.babylonjs.com/features/behaviour
  2039. * @returns null if behavior was not found else the requested behavior
  2040. */
  2041. getBehaviorByName(name: string): BABYLON.Nullable<BABYLON.Behavior<Control3D>>;
  2042. /** Gets or sets a boolean indicating if the control is visible */
  2043. isVisible: boolean;
  2044. /**
  2045. * Creates a new control
  2046. * @param name defines the control name
  2047. */
  2048. constructor(
  2049. /** Defines the control name */
  2050. name?: string | undefined);
  2051. /**
  2052. * Gets a string representing the class name
  2053. */
  2054. readonly typeName: string;
  2055. protected _getTypeName(): string;
  2056. /**
  2057. * Gets the transform node used by this control
  2058. */
  2059. readonly node: BABYLON.Nullable<BABYLON.TransformNode>;
  2060. /**
  2061. * Gets the mesh used to render this control
  2062. */
  2063. readonly mesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  2064. /**
  2065. * Link the control as child of the given node
  2066. * @param node defines the node to link to. Use null to unlink the control
  2067. * @returns the current control
  2068. */
  2069. linkToTransformNode(node: BABYLON.Nullable<BABYLON.TransformNode>): Control3D;
  2070. /** @hidden **/
  2071. _prepareNode(scene: BABYLON.Scene): void;
  2072. /**
  2073. * Node creation.
  2074. * Can be overriden by children
  2075. * @param scene defines the scene where the node must be attached
  2076. * @returns the attached node or null if none. Must return a BABYLON.Mesh or BABYLON.AbstractMesh if there is an atttached visible object
  2077. */
  2078. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  2079. /**
  2080. * Affect a material to the given mesh
  2081. * @param mesh defines the mesh which will represent the control
  2082. */
  2083. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2084. /** @hidden */
  2085. _onPointerMove(target: Control3D, coordinates: BABYLON.Vector3): void;
  2086. /** @hidden */
  2087. _onPointerEnter(target: Control3D): boolean;
  2088. /** @hidden */
  2089. _onPointerOut(target: Control3D): void;
  2090. /** @hidden */
  2091. _onPointerDown(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2092. /** @hidden */
  2093. _onPointerUp(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  2094. /** @hidden */
  2095. forcePointerUp(pointerId?: BABYLON.Nullable<number>): void;
  2096. /** @hidden */
  2097. _processObservables(type: number, pickedPoint: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2098. /** @hidden */
  2099. _disposeNode(): void;
  2100. /**
  2101. * Releases all associated resources
  2102. */
  2103. dispose(): void;
  2104. }
  2105. }
  2106. declare module BABYLON.GUI {
  2107. /**
  2108. * Class used to create a container panel deployed on the surface of a cylinder
  2109. */
  2110. export class CylinderPanel extends VolumeBasedPanel {
  2111. /**
  2112. * Gets or sets the radius of the cylinder where to project controls (5 by default)
  2113. */
  2114. radius: BABYLON.float;
  2115. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2116. }
  2117. }
  2118. declare module BABYLON.GUI {
  2119. /**
  2120. * Class used to create a holographic button in 3D
  2121. */
  2122. export class HolographicButton extends Button3D {
  2123. /**
  2124. * Gets or sets text for the button
  2125. */
  2126. text: string;
  2127. /**
  2128. * Gets or sets the image url for the button
  2129. */
  2130. imageUrl: string;
  2131. /**
  2132. * Gets the back material used by this button
  2133. */
  2134. readonly backMaterial: FluentMaterial;
  2135. /**
  2136. * Gets the front material used by this button
  2137. */
  2138. readonly frontMaterial: FluentMaterial;
  2139. /**
  2140. * Gets the plate material used by this button
  2141. */
  2142. readonly plateMaterial: BABYLON.StandardMaterial;
  2143. /**
  2144. * Gets a boolean indicating if this button shares its material with other HolographicButtons
  2145. */
  2146. readonly shareMaterials: boolean;
  2147. /**
  2148. * Creates a new button
  2149. * @param name defines the control name
  2150. */
  2151. constructor(name?: string, shareMaterials?: boolean);
  2152. protected _getTypeName(): string;
  2153. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2154. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  2155. protected _affectMaterial(mesh: BABYLON.Mesh): void;
  2156. /**
  2157. * Releases all associated resources
  2158. */
  2159. dispose(): void;
  2160. }
  2161. }
  2162. declare module BABYLON.GUI {
  2163. /**
  2164. * Class used to create an interactable object. It's a 3D button using a mesh coming from the current scene
  2165. */
  2166. export class MeshButton3D extends Button3D {
  2167. /** @hidden */
  2168. protected _currentMesh: BABYLON.Mesh;
  2169. /**
  2170. * Creates a new 3D button based on a mesh
  2171. * @param mesh mesh to become a 3D button
  2172. * @param name defines the control name
  2173. */
  2174. constructor(mesh: BABYLON.Mesh, name?: string);
  2175. protected _getTypeName(): string;
  2176. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2177. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2178. }
  2179. }
  2180. declare module BABYLON.GUI {
  2181. /**
  2182. * Class used to create a container panel deployed on the surface of a plane
  2183. */
  2184. export class PlanePanel extends VolumeBasedPanel {
  2185. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2186. }
  2187. }
  2188. declare module BABYLON.GUI {
  2189. /**
  2190. * Class used to create a container panel where items get randomized planar mapping
  2191. */
  2192. export class ScatterPanel extends VolumeBasedPanel {
  2193. /**
  2194. * Gets or sets the number of iteration to use to scatter the controls (100 by default)
  2195. */
  2196. iteration: BABYLON.float;
  2197. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2198. protected _finalProcessing(): void;
  2199. }
  2200. }
  2201. declare module BABYLON.GUI {
  2202. /**
  2203. * Class used to create a container panel deployed on the surface of a sphere
  2204. */
  2205. export class SpherePanel extends VolumeBasedPanel {
  2206. /**
  2207. * Gets or sets the radius of the sphere where to project controls (5 by default)
  2208. */
  2209. radius: BABYLON.float;
  2210. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2211. }
  2212. }
  2213. declare module BABYLON.GUI {
  2214. /**
  2215. * Class used to create a stack panel in 3D on XY plane
  2216. */
  2217. export class StackPanel3D extends Container3D {
  2218. /**
  2219. * Gets or sets a boolean indicating if the stack panel is vertical or horizontal (horizontal by default)
  2220. */
  2221. isVertical: boolean;
  2222. /**
  2223. * Gets or sets the distance between elements
  2224. */
  2225. margin: number;
  2226. /**
  2227. * Creates new StackPanel
  2228. * @param isVertical
  2229. */
  2230. constructor(isVertical?: boolean);
  2231. protected _arrangeChildren(): void;
  2232. }
  2233. }
  2234. declare module BABYLON.GUI {
  2235. /**
  2236. * Abstract class used to create a container panel deployed on the surface of a volume
  2237. */
  2238. export abstract class VolumeBasedPanel extends Container3D {
  2239. protected _cellWidth: number;
  2240. protected _cellHeight: number;
  2241. /**
  2242. * Gets or sets the distance between elements
  2243. */
  2244. margin: number;
  2245. /**
  2246. * Gets or sets the orientation to apply to all controls (BABYLON.Container3D.FaceOriginReversedOrientation by default)
  2247. * | Value | Type | Description |
  2248. * | ----- | ----------------------------------- | ----------- |
  2249. * | 0 | UNSET_ORIENTATION | Control rotation will remain unchanged |
  2250. * | 1 | FACEORIGIN_ORIENTATION | Control will rotate to make it look at sphere central axis |
  2251. * | 2 | FACEORIGINREVERSED_ORIENTATION | Control will rotate to make it look back at sphere central axis |
  2252. * | 3 | FACEFORWARD_ORIENTATION | Control will rotate to look at z axis (0, 0, 1) |
  2253. * | 4 | FACEFORWARDREVERSED_ORIENTATION | Control will rotate to look at negative z axis (0, 0, -1) |
  2254. */
  2255. orientation: number;
  2256. /**
  2257. * Gets or sets the number of columns requested (10 by default).
  2258. * The panel will automatically compute the number of rows based on number of child controls.
  2259. */
  2260. columns: BABYLON.int;
  2261. /**
  2262. * Gets or sets a the number of rows requested.
  2263. * The panel will automatically compute the number of columns based on number of child controls.
  2264. */
  2265. rows: BABYLON.int;
  2266. /**
  2267. * Creates new VolumeBasedPanel
  2268. */
  2269. constructor();
  2270. protected _arrangeChildren(): void;
  2271. /** Child classes must implement this function to provide correct control positioning */
  2272. protected abstract _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2273. /** Child classes can implement this function to provide additional processing */
  2274. protected _finalProcessing(): void;
  2275. }
  2276. }
  2277. declare module BABYLON.GUI {
  2278. /** @hidden */
  2279. export class FluentMaterialDefines extends BABYLON.MaterialDefines {
  2280. INNERGLOW: boolean;
  2281. BORDER: boolean;
  2282. HOVERLIGHT: boolean;
  2283. constructor();
  2284. }
  2285. /**
  2286. * Class used to render controls with fluent desgin
  2287. */
  2288. export class FluentMaterial extends BABYLON.PushMaterial {
  2289. /**
  2290. * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
  2291. */
  2292. innerGlowColorIntensity: number;
  2293. /**
  2294. * Gets or sets the inner glow color (white by default)
  2295. */
  2296. innerGlowColor: BABYLON.Color3;
  2297. /**
  2298. * Gets or sets alpha value (default is 1.0)
  2299. */
  2300. alpha: number;
  2301. /**
  2302. * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
  2303. */
  2304. albedoColor: BABYLON.Color3;
  2305. /**
  2306. * Gets or sets a boolean indicating if borders must be rendered (default is false)
  2307. */
  2308. renderBorders: boolean;
  2309. /**
  2310. * Gets or sets border width (default is 0.5)
  2311. */
  2312. borderWidth: number;
  2313. /**
  2314. * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
  2315. */
  2316. edgeSmoothingValue: number;
  2317. /**
  2318. * Gets or sets the minimum value that can be applied to border width (default is 0.1)
  2319. */
  2320. borderMinValue: number;
  2321. /**
  2322. * Gets or sets a boolean indicating if hover light must be rendered (default is false)
  2323. */
  2324. renderHoverLight: boolean;
  2325. /**
  2326. * Gets or sets the radius used to render the hover light (default is 0.15)
  2327. */
  2328. hoverRadius: number;
  2329. /**
  2330. * Gets or sets the color used to render the hover light (default is BABYLON.Color4(0.3, 0.3, 0.3, 1.0))
  2331. */
  2332. hoverColor: BABYLON.Color4;
  2333. /**
  2334. * Gets or sets the hover light position in world space (default is BABYLON.Vector3.Zero())
  2335. */
  2336. hoverPosition: BABYLON.Vector3;
  2337. /**
  2338. * Creates a new Fluent material
  2339. * @param name defines the name of the material
  2340. * @param scene defines the hosting scene
  2341. */
  2342. constructor(name: string, scene: BABYLON.Scene);
  2343. needAlphaBlending(): boolean;
  2344. needAlphaTesting(): boolean;
  2345. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  2346. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  2347. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  2348. getActiveTextures(): BABYLON.BaseTexture[];
  2349. hasTexture(texture: BABYLON.BaseTexture): boolean;
  2350. dispose(forceDisposeEffect?: boolean): void;
  2351. clone(name: string): FluentMaterial;
  2352. serialize(): any;
  2353. getClassName(): string;
  2354. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
  2355. }
  2356. }