babylon.gui.d.ts 132 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903
  1. /*Babylon.js 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. * Function called to get the list of controls that should not steal the focus from this control
  32. * @returns an array of controls
  33. */
  34. keepsFocusWith(): BABYLON.Nullable<Control[]>;
  35. }
  36. /**
  37. * Class used to create texture to support 2D GUI elements
  38. * @see http://doc.babylonjs.com/how_to/gui
  39. */
  40. export class AdvancedDynamicTexture extends BABYLON.DynamicTexture {
  41. /** @hidden */
  42. _rootContainer: Container;
  43. /** @hidden */
  44. _lastPickedControl: Control;
  45. /** @hidden */
  46. _lastControlOver: {
  47. [pointerId: number]: Control;
  48. };
  49. /** @hidden */
  50. _lastControlDown: {
  51. [pointerId: number]: Control;
  52. };
  53. /** @hidden */
  54. _capturingControl: {
  55. [pointerId: number]: Control;
  56. };
  57. /** @hidden */
  58. _shouldBlockPointer: boolean;
  59. /** @hidden */
  60. _layerToDispose: BABYLON.Nullable<BABYLON.Layer>;
  61. /** @hidden */
  62. _linkedControls: Control[];
  63. /** @hidden */
  64. _needRedraw: boolean;
  65. /**
  66. * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
  67. */
  68. onClipboardObservable: BABYLON.Observable<BABYLON.ClipboardInfo>;
  69. /**
  70. * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
  71. */
  72. onControlPickedObservable: BABYLON.Observable<Control>;
  73. /**
  74. * Gets or sets a boolean defining if alpha is stored as premultiplied
  75. */
  76. premulAlpha: boolean;
  77. /**
  78. * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
  79. * Useful when you want more antialiasing
  80. */
  81. renderScale: number;
  82. /** Gets or sets the background color */
  83. background: string;
  84. /**
  85. * Gets or sets the ideal width used to design controls.
  86. * The GUI will then rescale everything accordingly
  87. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  88. */
  89. idealWidth: number;
  90. /**
  91. * Gets or sets the ideal height used to design controls.
  92. * The GUI will then rescale everything accordingly
  93. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  94. */
  95. idealHeight: number;
  96. /**
  97. * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
  98. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  99. */
  100. useSmallestIdeal: boolean;
  101. /**
  102. * Gets or sets a boolean indicating if adaptive scaling must be used
  103. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  104. */
  105. renderAtIdealSize: boolean;
  106. /**
  107. * Gets the underlying layer used to render the texture when in fullscreen mode
  108. */
  109. readonly layer: BABYLON.Nullable<BABYLON.Layer>;
  110. /**
  111. * Gets the root container control
  112. */
  113. readonly rootContainer: Container;
  114. /**
  115. * Returns an array containing the root container.
  116. * This is mostly used to let the Inspector introspects the ADT
  117. * @returns an array containing the rootContainer
  118. */
  119. getChildren(): Array<Container>;
  120. /**
  121. * Will return all controls that are inside this texture
  122. * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
  123. * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
  124. * @return all child controls
  125. */
  126. getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
  127. /**
  128. * Gets or sets the current focused control
  129. */
  130. focusedControl: BABYLON.Nullable<IFocusableControl>;
  131. /**
  132. * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
  133. */
  134. isForeground: boolean;
  135. /**
  136. * Gets or set information about clipboardData
  137. */
  138. clipboardData: string;
  139. /**
  140. * Creates a new AdvancedDynamicTexture
  141. * @param name defines the name of the texture
  142. * @param width defines the width of the texture
  143. * @param height defines the height of the texture
  144. * @param scene defines the hosting scene
  145. * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
  146. * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
  147. */
  148. constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number);
  149. /**
  150. * Get the current class name of the texture useful for serialization or dynamic coding.
  151. * @returns "AdvancedDynamicTexture"
  152. */
  153. getClassName(): string;
  154. /**
  155. * Function used to execute a function on all controls
  156. * @param func defines the function to execute
  157. * @param container defines the container where controls belong. If null the root container will be used
  158. */
  159. executeOnAllControls(func: (control: Control) => void, container?: Container): void;
  160. /**
  161. * Marks the texture as dirty forcing a complete update
  162. */
  163. markAsDirty(): void;
  164. /**
  165. * Helper function used to create a new style
  166. * @returns a new style
  167. * @see http://doc.babylonjs.com/how_to/gui#styles
  168. */
  169. createStyle(): Style;
  170. /**
  171. * Adds a new control to the root container
  172. * @param control defines the control to add
  173. * @returns the current texture
  174. */
  175. addControl(control: Control): AdvancedDynamicTexture;
  176. /**
  177. * Removes a control from the root container
  178. * @param control defines the control to remove
  179. * @returns the current texture
  180. */
  181. removeControl(control: Control): AdvancedDynamicTexture;
  182. /**
  183. * Release all resources
  184. */
  185. dispose(): void;
  186. /** @hidden */
  187. _getGlobalViewport(scene: BABYLON.Scene): BABYLON.Viewport;
  188. /**
  189. * Get screen coordinates for a vector3
  190. * @param position defines the position to project
  191. * @param worldMatrix defines the world matrix to use
  192. * @returns the projected position
  193. */
  194. getProjectedPosition(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector2;
  195. /** @hidden */
  196. _changeCursor(cursor: string): void;
  197. /** @hidden */
  198. _registerLastControlDown(control: Control, pointerId: number): void;
  199. /** @hidden */
  200. _cleanControlAfterRemovalFromList(list: {
  201. [pointerId: number]: Control;
  202. }, control: Control): void;
  203. /** @hidden */
  204. _cleanControlAfterRemoval(control: Control): void;
  205. /** Attach to all scene events required to support pointer events */
  206. attach(): void;
  207. /**
  208. * Register the clipboard Events onto the canvas
  209. */
  210. registerClipboardEvents(): void;
  211. /**
  212. * Unregister the clipboard Events from the canvas
  213. */
  214. unRegisterClipboardEvents(): void;
  215. /**
  216. * Connect the texture to a hosting mesh to enable interactions
  217. * @param mesh defines the mesh to attach to
  218. * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
  219. */
  220. attachToMesh(mesh: BABYLON.AbstractMesh, supportPointerMove?: boolean): void;
  221. /**
  222. * Move the focus to a specific control
  223. * @param control defines the control which will receive the focus
  224. */
  225. moveFocusToControl(control: IFocusableControl): void;
  226. /**
  227. * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
  228. * @param mesh defines the mesh which will receive the texture
  229. * @param width defines the texture width (1024 by default)
  230. * @param height defines the texture height (1024 by default)
  231. * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
  232. * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
  233. * @returns a new AdvancedDynamicTexture
  234. */
  235. static CreateForMesh(mesh: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean): AdvancedDynamicTexture;
  236. /**
  237. * Creates a new AdvancedDynamicTexture in fullscreen mode.
  238. * In this mode the texture will rely on a layer for its rendering.
  239. * This allows it to be treated like any other layer.
  240. * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
  241. * LayerMask is set through advancedTexture.layer.layerMask
  242. * @param name defines name for the texture
  243. * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
  244. * @param scene defines the hsoting scene
  245. * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
  246. * @returns a new AdvancedDynamicTexture
  247. */
  248. static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number): AdvancedDynamicTexture;
  249. }
  250. }
  251. declare module BABYLON.GUI {
  252. /**
  253. * Class used to transport BABYLON.Vector2 information for pointer events
  254. */
  255. export class Vector2WithInfo extends BABYLON.Vector2 {
  256. /** defines the current mouse button index */
  257. buttonIndex: number;
  258. /**
  259. * Creates a new Vector2WithInfo
  260. * @param source defines the vector2 data to transport
  261. * @param buttonIndex defines the current mouse button index
  262. */
  263. constructor(source: BABYLON.Vector2,
  264. /** defines the current mouse button index */
  265. buttonIndex?: number);
  266. }
  267. /** Class used to provide 2D matrix features */
  268. export class Matrix2D {
  269. /** Gets the internal array of 6 floats used to store matrix data */
  270. m: Float32Array;
  271. /**
  272. * Creates a new matrix
  273. * @param m00 defines value for (0, 0)
  274. * @param m01 defines value for (0, 1)
  275. * @param m10 defines value for (1, 0)
  276. * @param m11 defines value for (1, 1)
  277. * @param m20 defines value for (2, 0)
  278. * @param m21 defines value for (2, 1)
  279. */
  280. constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
  281. /**
  282. * Fills the matrix from direct values
  283. * @param m00 defines value for (0, 0)
  284. * @param m01 defines value for (0, 1)
  285. * @param m10 defines value for (1, 0)
  286. * @param m11 defines value for (1, 1)
  287. * @param m20 defines value for (2, 0)
  288. * @param m21 defines value for (2, 1)
  289. * @returns the current modified matrix
  290. */
  291. fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
  292. /**
  293. * Gets matrix determinant
  294. * @returns the determinant
  295. */
  296. determinant(): number;
  297. /**
  298. * Inverses the matrix and stores it in a target matrix
  299. * @param result defines the target matrix
  300. * @returns the current matrix
  301. */
  302. invertToRef(result: Matrix2D): Matrix2D;
  303. /**
  304. * Multiplies the current matrix with another one
  305. * @param other defines the second operand
  306. * @param result defines the target matrix
  307. * @returns the current matrix
  308. */
  309. multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
  310. /**
  311. * Applies the current matrix to a set of 2 floats and stores the result in a vector2
  312. * @param x defines the x coordinate to transform
  313. * @param y defines the x coordinate to transform
  314. * @param result defines the target vector2
  315. * @returns the current matrix
  316. */
  317. transformCoordinates(x: number, y: number, result: BABYLON.Vector2): Matrix2D;
  318. /**
  319. * Creates an identity matrix
  320. * @returns a new matrix
  321. */
  322. static Identity(): Matrix2D;
  323. /**
  324. * Creates a translation matrix and stores it in a target matrix
  325. * @param x defines the x coordinate of the translation
  326. * @param y defines the y coordinate of the translation
  327. * @param result defines the target matrix
  328. */
  329. static TranslationToRef(x: number, y: number, result: Matrix2D): void;
  330. /**
  331. * Creates a scaling matrix and stores it in a target matrix
  332. * @param x defines the x coordinate of the scaling
  333. * @param y defines the y coordinate of the scaling
  334. * @param result defines the target matrix
  335. */
  336. static ScalingToRef(x: number, y: number, result: Matrix2D): void;
  337. /**
  338. * Creates a rotation matrix and stores it in a target matrix
  339. * @param angle defines the rotation angle
  340. * @param result defines the target matrix
  341. */
  342. static RotationToRef(angle: number, result: Matrix2D): void;
  343. /**
  344. * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
  345. * @param tx defines the x coordinate of the translation
  346. * @param ty defines the y coordinate of the translation
  347. * @param angle defines the rotation angle
  348. * @param scaleX defines the x coordinate of the scaling
  349. * @param scaleY defines the y coordinate of the scaling
  350. * @param parentMatrix defines the parent matrix to multiply by (can be null)
  351. * @param result defines the target matrix
  352. */
  353. static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: BABYLON.Nullable<Matrix2D>, result: Matrix2D): void;
  354. }
  355. }
  356. declare module BABYLON.GUI {
  357. /**
  358. * Class used to store 2D control sizes
  359. */
  360. export class Measure {
  361. /** defines left coordinate */
  362. left: number;
  363. /** defines top coordinate */
  364. top: number;
  365. /** defines width dimension */
  366. width: number;
  367. /** defines height dimension */
  368. height: number;
  369. /**
  370. * Creates a new measure
  371. * @param left defines left coordinate
  372. * @param top defines top coordinate
  373. * @param width defines width dimension
  374. * @param height defines height dimension
  375. */
  376. constructor(
  377. /** defines left coordinate */
  378. left: number,
  379. /** defines top coordinate */
  380. top: number,
  381. /** defines width dimension */
  382. width: number,
  383. /** defines height dimension */
  384. height: number);
  385. /**
  386. * Copy from another measure
  387. * @param other defines the other measure to copy from
  388. */
  389. copyFrom(other: Measure): void;
  390. /**
  391. * Copy from a group of 4 floats
  392. * @param left defines left coordinate
  393. * @param top defines top coordinate
  394. * @param width defines width dimension
  395. * @param height defines height dimension
  396. */
  397. copyFromFloats(left: number, top: number, width: number, height: number): void;
  398. /**
  399. * Check equality between this measure and another one
  400. * @param other defines the other measures
  401. * @returns true if both measures are equals
  402. */
  403. isEqualsTo(other: Measure): boolean;
  404. /**
  405. * Creates an empty measure
  406. * @returns a new measure
  407. */
  408. static Empty(): Measure;
  409. }
  410. }
  411. declare module BABYLON.GUI {
  412. /**
  413. * Class used to store a point for a MultiLine object.
  414. * The point can be pure 2D coordinates, a mesh or a control
  415. */
  416. export class MultiLinePoint {
  417. /** @hidden */
  418. _point: BABYLON.Vector2;
  419. /**
  420. * Creates a new MultiLinePoint
  421. * @param multiLine defines the source MultiLine object
  422. */
  423. constructor(multiLine: MultiLine);
  424. /** Gets or sets x coordinate */
  425. x: string | number;
  426. /** Gets or sets y coordinate */
  427. y: string | number;
  428. /** Gets or sets the control associated with this point */
  429. control: BABYLON.Nullable<Control>;
  430. /** Gets or sets the mesh associated with this point */
  431. mesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  432. /** Resets links */
  433. resetLinks(): void;
  434. /**
  435. * Gets a translation vector
  436. * @returns the translation vector
  437. */
  438. translate(): BABYLON.Vector2;
  439. /** Release associated resources */
  440. dispose(): void;
  441. }
  442. }
  443. declare module BABYLON.GUI {
  444. /**
  445. * Define a style used by control to automatically setup properties based on a template.
  446. * Only support font related properties so far
  447. */
  448. export class Style implements BABYLON.IDisposable {
  449. /** @hidden */
  450. _host: AdvancedDynamicTexture;
  451. /** @hidden */
  452. _fontSize: ValueAndUnit;
  453. /**
  454. * BABYLON.Observable raised when the style values are changed
  455. */
  456. onChangedObservable: BABYLON.Observable<Style>;
  457. /**
  458. * Creates a new style object
  459. * @param host defines the AdvancedDynamicTexture which hosts this style
  460. */
  461. constructor(host: AdvancedDynamicTexture);
  462. /**
  463. * Gets or sets the font size
  464. */
  465. fontSize: string | number;
  466. /**
  467. * Gets or sets the font family
  468. */
  469. fontFamily: string;
  470. /**
  471. * Gets or sets the font style
  472. */
  473. fontStyle: string;
  474. /** Gets or sets font weight */
  475. fontWeight: string;
  476. /** Dispose all associated resources */
  477. dispose(): void;
  478. }
  479. }
  480. declare module BABYLON.GUI {
  481. /**
  482. * Class used to specific a value and its associated unit
  483. */
  484. export class ValueAndUnit {
  485. /** defines the unit to store */
  486. unit: number;
  487. /** defines a boolean indicating if the value can be negative */
  488. negativeValueAllowed: boolean;
  489. /**
  490. * Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
  491. * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
  492. */
  493. ignoreAdaptiveScaling: boolean;
  494. /**
  495. * Creates a new ValueAndUnit
  496. * @param value defines the value to store
  497. * @param unit defines the unit to store
  498. * @param negativeValueAllowed defines a boolean indicating if the value can be negative
  499. */
  500. constructor(value: number,
  501. /** defines the unit to store */
  502. unit?: number,
  503. /** defines a boolean indicating if the value can be negative */
  504. negativeValueAllowed?: boolean);
  505. /** Gets a boolean indicating if the value is a percentage */
  506. readonly isPercentage: boolean;
  507. /** Gets a boolean indicating if the value is store as pixel */
  508. readonly isPixel: boolean;
  509. /** Gets direct internal value */
  510. readonly internalValue: number;
  511. /**
  512. * Gets value as pixel
  513. * @param host defines the root host
  514. * @param refValue defines the reference value for percentages
  515. * @returns the value as pixel
  516. */
  517. getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
  518. /**
  519. * Gets the value accordingly to its unit
  520. * @param host defines the root host
  521. * @returns the value
  522. */
  523. getValue(host: AdvancedDynamicTexture): number;
  524. /**
  525. * Gets a string representation of the value
  526. * @param host defines the root host
  527. * @returns a string
  528. */
  529. toString(host: AdvancedDynamicTexture): string;
  530. /**
  531. * Store a value parsed from a string
  532. * @param source defines the source string
  533. * @returns true if the value was successfully parsed
  534. */
  535. fromString(source: string | number): boolean;
  536. /** UNITMODE_PERCENTAGE */
  537. static readonly UNITMODE_PERCENTAGE: number;
  538. /** UNITMODE_PIXEL */
  539. static readonly UNITMODE_PIXEL: number;
  540. }
  541. }
  542. declare module BABYLON.GUI {
  543. }
  544. declare module BABYLON.GUI {
  545. }
  546. declare module BABYLON.GUI {
  547. /**
  548. * Class used to manage 3D user interface
  549. * @see http://doc.babylonjs.com/how_to/gui3d
  550. */
  551. export class GUI3DManager implements BABYLON.IDisposable {
  552. /** @hidden */
  553. _lastPickedControl: Control3D;
  554. /** @hidden */
  555. _lastControlOver: {
  556. [pointerId: number]: Control3D;
  557. };
  558. /** @hidden */
  559. _lastControlDown: {
  560. [pointerId: number]: Control3D;
  561. };
  562. /**
  563. * BABYLON.Observable raised when the point picked by the pointer events changed
  564. */
  565. onPickedPointChangedObservable: BABYLON.Observable<BABYLON.Nullable<BABYLON.Vector3>>;
  566. /** @hidden */
  567. _sharedMaterials: {
  568. [key: string]: BABYLON.Material;
  569. };
  570. /** Gets the hosting scene */
  571. readonly scene: BABYLON.Scene;
  572. /** Gets associated utility layer */
  573. readonly utilityLayer: BABYLON.Nullable<BABYLON.UtilityLayerRenderer>;
  574. /**
  575. * Creates a new GUI3DManager
  576. * @param scene
  577. */
  578. constructor(scene?: BABYLON.Scene);
  579. /**
  580. * Gets the root container
  581. */
  582. readonly rootContainer: Container3D;
  583. /**
  584. * Gets a boolean indicating if the given control is in the root child list
  585. * @param control defines the control to check
  586. * @returns true if the control is in the root child list
  587. */
  588. containsControl(control: Control3D): boolean;
  589. /**
  590. * Adds a control to the root child list
  591. * @param control defines the control to add
  592. * @returns the current manager
  593. */
  594. addControl(control: Control3D): GUI3DManager;
  595. /**
  596. * Removes a control from the root child list
  597. * @param control defines the control to remove
  598. * @returns the current container
  599. */
  600. removeControl(control: Control3D): GUI3DManager;
  601. /**
  602. * Releases all associated resources
  603. */
  604. dispose(): void;
  605. }
  606. }
  607. declare module BABYLON.GUI {
  608. /**
  609. * Class used to transport BABYLON.Vector3 information for pointer events
  610. */
  611. export class Vector3WithInfo extends BABYLON.Vector3 {
  612. /** defines the current mouse button index */
  613. buttonIndex: number;
  614. /**
  615. * Creates a new Vector3WithInfo
  616. * @param source defines the vector3 data to transport
  617. * @param buttonIndex defines the current mouse button index
  618. */
  619. constructor(source: BABYLON.Vector3,
  620. /** defines the current mouse button index */
  621. buttonIndex?: number);
  622. }
  623. }
  624. declare module BABYLON.GUI {
  625. /**
  626. * Class used to create 2D buttons
  627. */
  628. export class Button extends Rectangle {
  629. name?: string | undefined;
  630. /**
  631. * Function called to generate a pointer enter animation
  632. */
  633. pointerEnterAnimation: () => void;
  634. /**
  635. * Function called to generate a pointer out animation
  636. */
  637. pointerOutAnimation: () => void;
  638. /**
  639. * Function called to generate a pointer down animation
  640. */
  641. pointerDownAnimation: () => void;
  642. /**
  643. * Function called to generate a pointer up animation
  644. */
  645. pointerUpAnimation: () => void;
  646. /**
  647. * Returns the image part of the button (if any)
  648. */
  649. readonly image: BABYLON.Nullable<Image>;
  650. /**
  651. * Returns the image part of the button (if any)
  652. */
  653. readonly textBlock: BABYLON.Nullable<TextBlock>;
  654. /**
  655. * Creates a new Button
  656. * @param name defines the name of the button
  657. */
  658. constructor(name?: string | undefined);
  659. protected _getTypeName(): string;
  660. /** @hidden */
  661. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  662. /** @hidden */
  663. _onPointerEnter(target: Control): boolean;
  664. /** @hidden */
  665. _onPointerOut(target: Control): void;
  666. /** @hidden */
  667. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  668. /** @hidden */
  669. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  670. /**
  671. * Creates a new button made with an image and a text
  672. * @param name defines the name of the button
  673. * @param text defines the text of the button
  674. * @param imageUrl defines the url of the image
  675. * @returns a new Button
  676. */
  677. static CreateImageButton(name: string, text: string, imageUrl: string): Button;
  678. /**
  679. * Creates a new button made with an image
  680. * @param name defines the name of the button
  681. * @param imageUrl defines the url of the image
  682. * @returns a new Button
  683. */
  684. static CreateImageOnlyButton(name: string, imageUrl: string): Button;
  685. /**
  686. * Creates a new button made with a text
  687. * @param name defines the name of the button
  688. * @param text defines the text of the button
  689. * @returns a new Button
  690. */
  691. static CreateSimpleButton(name: string, text: string): Button;
  692. /**
  693. * Creates a new button made with an image and a centered text
  694. * @param name defines the name of the button
  695. * @param text defines the text of the button
  696. * @param imageUrl defines the url of the image
  697. * @returns a new Button
  698. */
  699. static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
  700. }
  701. }
  702. declare module BABYLON.GUI {
  703. /**
  704. * Class used to represent a 2D checkbox
  705. */
  706. export class Checkbox extends Control {
  707. name?: string | undefined;
  708. /** Gets or sets border thickness */
  709. thickness: number;
  710. /**
  711. * BABYLON.Observable raised when isChecked property changes
  712. */
  713. onIsCheckedChangedObservable: BABYLON.Observable<boolean>;
  714. /** Gets or sets a value indicating the ratio between overall size and check size */
  715. checkSizeRatio: number;
  716. /** Gets or sets background color */
  717. background: string;
  718. /** Gets or sets a boolean indicating if the checkbox is checked or not */
  719. isChecked: boolean;
  720. /**
  721. * Creates a new CheckBox
  722. * @param name defines the control name
  723. */
  724. constructor(name?: string | undefined);
  725. protected _getTypeName(): string;
  726. /** @hidden */
  727. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  728. /** @hidden */
  729. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  730. /**
  731. * Utility function to easily create a checkbox with a header
  732. * @param title defines the label to use for the header
  733. * @param onValueChanged defines the callback to call when value changes
  734. * @returns a StackPanel containing the checkbox and a textBlock
  735. */
  736. static AddCheckBoxWithHeader(title: string, onValueChanged: (value: boolean) => void): StackPanel;
  737. }
  738. }
  739. declare module BABYLON.GUI {
  740. /** Class used to create color pickers */
  741. export class ColorPicker extends Control {
  742. name?: string | undefined;
  743. /**
  744. * BABYLON.Observable raised when the value changes
  745. */
  746. onValueChangedObservable: BABYLON.Observable<BABYLON.Color3>;
  747. /** Gets or sets the color of the color picker */
  748. value: BABYLON.Color3;
  749. /** Gets or sets control width */
  750. width: string | number;
  751. /** Gets or sets control height */
  752. height: string | number;
  753. /** Gets or sets control size */
  754. size: string | number;
  755. /**
  756. * Creates a new ColorPicker
  757. * @param name defines the control name
  758. */
  759. constructor(name?: string | undefined);
  760. protected _getTypeName(): string;
  761. /** @hidden */
  762. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  763. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  764. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  765. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  766. }
  767. }
  768. declare module BABYLON.GUI {
  769. /**
  770. * Root class for 2D containers
  771. * @see http://doc.babylonjs.com/how_to/gui#containers
  772. */
  773. export class Container extends Control {
  774. name?: string | undefined;
  775. /** @hidden */
  776. protected _children: Control[];
  777. /** @hidden */
  778. protected _measureForChildren: Measure;
  779. /** @hidden */
  780. protected _background: string;
  781. /** @hidden */
  782. protected _adaptWidthToChildren: boolean;
  783. /** @hidden */
  784. protected _adaptHeightToChildren: boolean;
  785. /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
  786. adaptHeightToChildren: boolean;
  787. /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
  788. adaptWidthToChildren: boolean;
  789. /** Gets or sets background color */
  790. background: string;
  791. /** Gets the list of children */
  792. readonly children: Control[];
  793. /**
  794. * Creates a new Container
  795. * @param name defines the name of the container
  796. */
  797. constructor(name?: string | undefined);
  798. protected _getTypeName(): string;
  799. _flagDescendantsAsMatrixDirty(): void;
  800. /**
  801. * Gets a child using its name
  802. * @param name defines the child name to look for
  803. * @returns the child control if found
  804. */
  805. getChildByName(name: string): BABYLON.Nullable<Control>;
  806. /**
  807. * Gets a child using its type and its name
  808. * @param name defines the child name to look for
  809. * @param type defines the child type to look for
  810. * @returns the child control if found
  811. */
  812. getChildByType(name: string, type: string): BABYLON.Nullable<Control>;
  813. /**
  814. * Search for a specific control in children
  815. * @param control defines the control to look for
  816. * @returns true if the control is in child list
  817. */
  818. containsControl(control: Control): boolean;
  819. /**
  820. * Adds a new control to the current container
  821. * @param control defines the control to add
  822. * @returns the current container
  823. */
  824. addControl(control: BABYLON.Nullable<Control>): Container;
  825. /**
  826. * Removes all controls from the current container
  827. * @returns the current container
  828. */
  829. clearControls(): Container;
  830. /**
  831. * Removes a control from the current container
  832. * @param control defines the control to remove
  833. * @returns the current container
  834. */
  835. removeControl(control: Control): Container;
  836. /** @hidden */
  837. _reOrderControl(control: Control): void;
  838. /** @hidden */
  839. _markAllAsDirty(): void;
  840. /** @hidden */
  841. protected _localDraw(context: CanvasRenderingContext2D): void;
  842. /** @hidden */
  843. _link(root: BABYLON.Nullable<Container>, host: AdvancedDynamicTexture): void;
  844. /** @hidden */
  845. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  846. /** @hidden */
  847. _getDescendants(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void;
  848. /** @hidden */
  849. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  850. /** @hidden */
  851. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  852. /** @hidden */
  853. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  854. /** Releases associated resources */
  855. dispose(): void;
  856. }
  857. }
  858. declare module BABYLON.GUI {
  859. /**
  860. * Root class used for all 2D controls
  861. * @see http://doc.babylonjs.com/how_to/gui#controls
  862. */
  863. export class Control {
  864. /** defines the name of the control */
  865. name?: string | undefined;
  866. /**
  867. * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
  868. */
  869. static AllowAlphaInheritance: boolean;
  870. /** @hidden */
  871. _root: BABYLON.Nullable<Container>;
  872. /** @hidden */
  873. _host: AdvancedDynamicTexture;
  874. /** Gets or sets the control parent */
  875. parent: BABYLON.Nullable<Container>;
  876. /** @hidden */
  877. _currentMeasure: Measure;
  878. /** @hidden */
  879. _width: ValueAndUnit;
  880. /** @hidden */
  881. _height: ValueAndUnit;
  882. /** @hidden */
  883. protected _fontOffset: {
  884. ascent: number;
  885. height: number;
  886. descent: number;
  887. };
  888. /** @hidden */
  889. protected _horizontalAlignment: number;
  890. /** @hidden */
  891. protected _verticalAlignment: number;
  892. /** @hidden */
  893. _tempParentMeasure: Measure;
  894. /** @hidden */
  895. protected _cachedParentMeasure: Measure;
  896. /** @hidden */
  897. _left: ValueAndUnit;
  898. /** @hidden */
  899. _top: ValueAndUnit;
  900. /** @hidden */
  901. protected _invertTransformMatrix: Matrix2D;
  902. /** @hidden */
  903. protected _transformedPosition: BABYLON.Vector2;
  904. /** @hidden */
  905. _linkedMesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  906. protected _isEnabled: boolean;
  907. protected _disabledColor: string;
  908. /** @hidden */
  909. _tag: any;
  910. /**
  911. * Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container
  912. */
  913. uniqueId: number;
  914. /**
  915. * Gets or sets an object used to store user defined information for the node
  916. */
  917. metadata: any;
  918. /** Gets or sets a boolean indicating if the control can be hit with pointer events */
  919. isHitTestVisible: boolean;
  920. /** Gets or sets a boolean indicating if the control can block pointer events */
  921. isPointerBlocker: boolean;
  922. /** Gets or sets a boolean indicating if the control can be focusable */
  923. isFocusInvisible: boolean;
  924. /** Gets or sets a boolean indicating if the children are clipped to the current control bounds */
  925. clipChildren: boolean;
  926. /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
  927. shadowOffsetX: number;
  928. /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
  929. shadowOffsetY: number;
  930. /** Gets or sets a value indicating the amount of blur to use to render the shadow */
  931. shadowBlur: number;
  932. /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
  933. shadowColor: string;
  934. /** Gets or sets the cursor to use when the control is hovered */
  935. hoverCursor: string;
  936. /** @hidden */
  937. protected _linkOffsetX: ValueAndUnit;
  938. /** @hidden */
  939. protected _linkOffsetY: ValueAndUnit;
  940. /** Gets the control type name */
  941. readonly typeName: string;
  942. /**
  943. * Get the current class name of the control.
  944. * @returns current class name
  945. */
  946. getClassName(): string;
  947. /**
  948. * An event triggered when the pointer move over the control.
  949. */
  950. onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector2>;
  951. /**
  952. * An event triggered when the pointer move out of the control.
  953. */
  954. onPointerOutObservable: BABYLON.Observable<Control>;
  955. /**
  956. * An event triggered when the pointer taps the control
  957. */
  958. onPointerDownObservable: BABYLON.Observable<Vector2WithInfo>;
  959. /**
  960. * An event triggered when pointer up
  961. */
  962. onPointerUpObservable: BABYLON.Observable<Vector2WithInfo>;
  963. /**
  964. * An event triggered when a control is clicked on
  965. */
  966. onPointerClickObservable: BABYLON.Observable<Vector2WithInfo>;
  967. /**
  968. * An event triggered when pointer enters the control
  969. */
  970. onPointerEnterObservable: BABYLON.Observable<Control>;
  971. /**
  972. * An event triggered when the control is marked as dirty
  973. */
  974. onDirtyObservable: BABYLON.Observable<Control>;
  975. /**
  976. * An event triggered before drawing the control
  977. */
  978. onBeforeDrawObservable: BABYLON.Observable<Control>;
  979. /**
  980. * An event triggered after the control was drawn
  981. */
  982. onAfterDrawObservable: BABYLON.Observable<Control>;
  983. /** Gets or set information about font offsets (used to render and align text) */
  984. fontOffset: {
  985. ascent: number;
  986. height: number;
  987. descent: number;
  988. };
  989. /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
  990. alpha: number;
  991. /**
  992. * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
  993. */
  994. isHighlighted: boolean;
  995. /** Gets or sets a value indicating the scale factor on X axis (1 by default)
  996. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  997. */
  998. scaleX: number;
  999. /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
  1000. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  1001. */
  1002. scaleY: number;
  1003. /** Gets or sets the rotation angle (0 by default)
  1004. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  1005. */
  1006. rotation: number;
  1007. /** Gets or sets the transformation center on Y axis (0 by default)
  1008. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  1009. */
  1010. transformCenterY: number;
  1011. /** Gets or sets the transformation center on X axis (0 by default)
  1012. * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
  1013. */
  1014. transformCenterX: number;
  1015. /**
  1016. * Gets or sets the horizontal alignment
  1017. * @see http://doc.babylonjs.com/how_to/gui#alignments
  1018. */
  1019. horizontalAlignment: number;
  1020. /**
  1021. * Gets or sets the vertical alignment
  1022. * @see http://doc.babylonjs.com/how_to/gui#alignments
  1023. */
  1024. verticalAlignment: number;
  1025. /**
  1026. * Gets or sets control width
  1027. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1028. */
  1029. width: string | number;
  1030. /**
  1031. * Gets control width in pixel
  1032. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1033. */
  1034. readonly widthInPixels: number;
  1035. /**
  1036. * Gets or sets control height
  1037. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1038. */
  1039. height: string | number;
  1040. /**
  1041. * Gets control height in pixel
  1042. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1043. */
  1044. readonly heightInPixels: number;
  1045. /** Gets or set font family */
  1046. fontFamily: string;
  1047. /** Gets or sets font style */
  1048. fontStyle: string;
  1049. /** Gets or sets font weight */
  1050. fontWeight: string;
  1051. /**
  1052. * Gets or sets style
  1053. * @see http://doc.babylonjs.com/how_to/gui#styles
  1054. */
  1055. style: BABYLON.Nullable<Style>;
  1056. /** @hidden */
  1057. readonly _isFontSizeInPercentage: boolean;
  1058. /** Gets font size in pixels */
  1059. readonly fontSizeInPixels: number;
  1060. /** Gets or sets font size */
  1061. fontSize: string | number;
  1062. /** Gets or sets foreground color */
  1063. color: string;
  1064. /** Gets or sets z index which is used to reorder controls on the z axis */
  1065. zIndex: number;
  1066. /** Gets or sets a boolean indicating if the control can be rendered */
  1067. notRenderable: boolean;
  1068. /** Gets or sets a boolean indicating if the control is visible */
  1069. isVisible: boolean;
  1070. /** Gets a boolean indicating that the control needs to update its rendering */
  1071. readonly isDirty: boolean;
  1072. /**
  1073. * Gets the current linked mesh (or null if none)
  1074. */
  1075. readonly linkedMesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  1076. /**
  1077. * Gets or sets a value indicating the padding to use on the left of the control
  1078. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1079. */
  1080. paddingLeft: string | number;
  1081. /**
  1082. * Gets a value indicating the padding in pixels to use on the left of the control
  1083. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1084. */
  1085. readonly paddingLeftInPixels: number;
  1086. /**
  1087. * Gets or sets a value indicating the padding to use on the right of the control
  1088. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1089. */
  1090. paddingRight: string | number;
  1091. /**
  1092. * Gets a value indicating the padding in pixels to use on the right of the control
  1093. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1094. */
  1095. readonly paddingRightInPixels: number;
  1096. /**
  1097. * Gets or sets a value indicating the padding to use on the top of the control
  1098. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1099. */
  1100. paddingTop: string | number;
  1101. /**
  1102. * Gets a value indicating the padding in pixels to use on the top of the control
  1103. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1104. */
  1105. readonly paddingTopInPixels: number;
  1106. /**
  1107. * Gets or sets a value indicating the padding to use on the bottom of the control
  1108. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1109. */
  1110. paddingBottom: string | number;
  1111. /**
  1112. * Gets a value indicating the padding in pixels to use on the bottom of the control
  1113. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1114. */
  1115. readonly paddingBottomInPixels: number;
  1116. /**
  1117. * Gets or sets a value indicating the left coordinate of the control
  1118. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1119. */
  1120. left: string | number;
  1121. /**
  1122. * Gets a value indicating the left coordinate in pixels of the control
  1123. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1124. */
  1125. readonly leftInPixels: number;
  1126. /**
  1127. * Gets or sets a value indicating the top coordinate of the control
  1128. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1129. */
  1130. top: string | number;
  1131. /**
  1132. * Gets a value indicating the top coordinate in pixels of the control
  1133. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1134. */
  1135. readonly topInPixels: number;
  1136. /**
  1137. * Gets or sets a value indicating the offset on X axis to the linked mesh
  1138. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1139. */
  1140. linkOffsetX: string | number;
  1141. /**
  1142. * Gets a value indicating the offset in pixels on X axis to the linked mesh
  1143. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1144. */
  1145. readonly linkOffsetXInPixels: number;
  1146. /**
  1147. * Gets or sets a value indicating the offset on Y axis to the linked mesh
  1148. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1149. */
  1150. linkOffsetY: string | number;
  1151. /**
  1152. * Gets a value indicating the offset in pixels on Y axis to the linked mesh
  1153. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1154. */
  1155. readonly linkOffsetYInPixels: number;
  1156. /** Gets the center coordinate on X axis */
  1157. readonly centerX: number;
  1158. /** Gets the center coordinate on Y axis */
  1159. readonly centerY: number;
  1160. /** Gets or sets if control is Enabled*/
  1161. isEnabled: boolean;
  1162. /** Gets or sets background color of control if it's disabled*/
  1163. disabledColor: string;
  1164. /**
  1165. * Creates a new control
  1166. * @param name defines the name of the control
  1167. */
  1168. constructor(
  1169. /** defines the name of the control */
  1170. name?: string | undefined);
  1171. /** @hidden */
  1172. protected _getTypeName(): string;
  1173. /** @hidden */
  1174. _resetFontCache(): void;
  1175. /**
  1176. * Determines if a container is an ascendant of the current control
  1177. * @param container defines the container to look for
  1178. * @returns true if the container is one of the ascendant of the control
  1179. */
  1180. isAscendant(container: Control): boolean;
  1181. /**
  1182. * Gets coordinates in local control space
  1183. * @param globalCoordinates defines the coordinates to transform
  1184. * @returns the new coordinates in local space
  1185. */
  1186. getLocalCoordinates(globalCoordinates: BABYLON.Vector2): BABYLON.Vector2;
  1187. /**
  1188. * Gets coordinates in local control space
  1189. * @param globalCoordinates defines the coordinates to transform
  1190. * @param result defines the target vector2 where to store the result
  1191. * @returns the current control
  1192. */
  1193. getLocalCoordinatesToRef(globalCoordinates: BABYLON.Vector2, result: BABYLON.Vector2): Control;
  1194. /**
  1195. * Gets coordinates in parent local control space
  1196. * @param globalCoordinates defines the coordinates to transform
  1197. * @returns the new coordinates in parent local space
  1198. */
  1199. getParentLocalCoordinates(globalCoordinates: BABYLON.Vector2): BABYLON.Vector2;
  1200. /**
  1201. * Move the current control to a vector3 position projected onto the screen.
  1202. * @param position defines the target position
  1203. * @param scene defines the hosting scene
  1204. */
  1205. moveToVector3(position: BABYLON.Vector3, scene: BABYLON.Scene): void;
  1206. /** @hidden */
  1207. _getDescendants(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void;
  1208. /**
  1209. * Will return all controls that have this control as ascendant
  1210. * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
  1211. * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
  1212. * @return all child controls
  1213. */
  1214. getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
  1215. /**
  1216. * Link current control with a target mesh
  1217. * @param mesh defines the mesh to link with
  1218. * @see http://doc.babylonjs.com/how_to/gui#tracking-positions
  1219. */
  1220. linkWithMesh(mesh: BABYLON.Nullable<BABYLON.AbstractMesh>): void;
  1221. /** @hidden */
  1222. _moveToProjectedPosition(projectedPosition: BABYLON.Vector3): void;
  1223. /** @hidden */
  1224. _markMatrixAsDirty(): void;
  1225. /** @hidden */
  1226. _flagDescendantsAsMatrixDirty(): void;
  1227. /** @hidden */
  1228. _markAsDirty(force?: boolean): void;
  1229. /** @hidden */
  1230. _markAllAsDirty(): void;
  1231. /** @hidden */
  1232. _link(root: BABYLON.Nullable<Container>, host: AdvancedDynamicTexture): void;
  1233. /** @hidden */
  1234. protected _transform(context: CanvasRenderingContext2D): void;
  1235. /** @hidden */
  1236. _renderHighlight(context: CanvasRenderingContext2D): void;
  1237. /** @hidden */
  1238. protected _renderHighlightSpecific(context: CanvasRenderingContext2D): void;
  1239. /** @hidden */
  1240. protected _applyStates(context: CanvasRenderingContext2D): void;
  1241. /** @hidden */
  1242. protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
  1243. /** @hidden */
  1244. protected _clip(context: CanvasRenderingContext2D): void;
  1245. /** @hidden */
  1246. _measure(): void;
  1247. /** @hidden */
  1248. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1249. /** @hidden */
  1250. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1251. /** @hidden */
  1252. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1253. /** @hidden */
  1254. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1255. /**
  1256. * Tests if a given coordinates belong to the current control
  1257. * @param x defines x coordinate to test
  1258. * @param y defines y coordinate to test
  1259. * @returns true if the coordinates are inside the control
  1260. */
  1261. contains(x: number, y: number): boolean;
  1262. /** @hidden */
  1263. _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
  1264. /** @hidden */
  1265. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  1266. /** @hidden */
  1267. _onPointerEnter(target: Control): boolean;
  1268. /** @hidden */
  1269. _onPointerOut(target: Control): void;
  1270. /** @hidden */
  1271. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1272. /** @hidden */
  1273. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  1274. /** @hidden */
  1275. _forcePointerUp(pointerId?: BABYLON.Nullable<number>): void;
  1276. /** @hidden */
  1277. _processObservables(type: number, x: number, y: number, pointerId: number, buttonIndex: number): boolean;
  1278. /** Releases associated resources */
  1279. dispose(): void;
  1280. /** HORIZONTAL_ALIGNMENT_LEFT */
  1281. static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
  1282. /** HORIZONTAL_ALIGNMENT_RIGHT */
  1283. static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
  1284. /** HORIZONTAL_ALIGNMENT_CENTER */
  1285. static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
  1286. /** VERTICAL_ALIGNMENT_TOP */
  1287. static readonly VERTICAL_ALIGNMENT_TOP: number;
  1288. /** VERTICAL_ALIGNMENT_BOTTOM */
  1289. static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
  1290. /** VERTICAL_ALIGNMENT_CENTER */
  1291. static readonly VERTICAL_ALIGNMENT_CENTER: number;
  1292. /** @hidden */
  1293. static _GetFontOffset(font: string): {
  1294. ascent: number;
  1295. height: number;
  1296. descent: number;
  1297. };
  1298. /**
  1299. * Creates a stack panel that can be used to render headers
  1300. * @param control defines the control to associate with the header
  1301. * @param text defines the text of the header
  1302. * @param size defines the size of the header
  1303. * @param options defines options used to configure the header
  1304. * @returns a new StackPanel
  1305. * @ignore
  1306. * @hidden
  1307. */
  1308. static AddHeader: (control: Control, text: string, size: string | number, options: {
  1309. isHorizontal: boolean;
  1310. controlFirst: boolean;
  1311. }) => any;
  1312. /** @hidden */
  1313. protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
  1314. }
  1315. }
  1316. declare module BABYLON.GUI {
  1317. /** Class used to create 2D ellipse containers */
  1318. export class Ellipse extends Container {
  1319. name?: string | undefined;
  1320. /** Gets or sets border thickness */
  1321. thickness: number;
  1322. /**
  1323. * Creates a new Ellipse
  1324. * @param name defines the control name
  1325. */
  1326. constructor(name?: string | undefined);
  1327. protected _getTypeName(): string;
  1328. protected _localDraw(context: CanvasRenderingContext2D): void;
  1329. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1330. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  1331. }
  1332. }
  1333. declare module BABYLON.GUI {
  1334. /**
  1335. * Class used to create a 2D grid container
  1336. */
  1337. export class Grid extends Container {
  1338. name?: string | undefined;
  1339. /**
  1340. * Gets the number of columns
  1341. */
  1342. readonly columnCount: number;
  1343. /**
  1344. * Gets the number of rows
  1345. */
  1346. readonly rowCount: number;
  1347. /** Gets the list of children */
  1348. readonly children: Control[];
  1349. /**
  1350. * Adds a new row to the grid
  1351. * @param height defines the height of the row (either in pixel or a value between 0 and 1)
  1352. * @param isPixel defines if the height is expressed in pixel (or in percentage)
  1353. * @returns the current grid
  1354. */
  1355. addRowDefinition(height: number, isPixel?: boolean): Grid;
  1356. /**
  1357. * Adds a new column to the grid
  1358. * @param width defines the width of the column (either in pixel or a value between 0 and 1)
  1359. * @param isPixel defines if the width is expressed in pixel (or in percentage)
  1360. * @returns the current grid
  1361. */
  1362. addColumnDefinition(width: number, isPixel?: boolean): Grid;
  1363. /**
  1364. * Update a row definition
  1365. * @param index defines the index of the row to update
  1366. * @param height defines the height of the row (either in pixel or a value between 0 and 1)
  1367. * @param isPixel defines if the weight is expressed in pixel (or in percentage)
  1368. * @returns the current grid
  1369. */
  1370. setRowDefinition(index: number, height: number, isPixel?: boolean): Grid;
  1371. /**
  1372. * Update a column definition
  1373. * @param index defines the index of the column to update
  1374. * @param width defines the width of the column (either in pixel or a value between 0 and 1)
  1375. * @param isPixel defines if the width is expressed in pixel (or in percentage)
  1376. * @returns the current grid
  1377. */
  1378. setColumnDefinition(index: number, width: number, isPixel?: boolean): Grid;
  1379. /**
  1380. * Gets the list of children stored in a specific cell
  1381. * @param row defines the row to check
  1382. * @param column defines the column to check
  1383. * @returns the list of controls
  1384. */
  1385. getChildrenAt(row: number, column: number): BABYLON.Nullable<Array<Control>>;
  1386. /**
  1387. * Remove a column definition at specified index
  1388. * @param index defines the index of the column to remove
  1389. * @returns the current grid
  1390. */
  1391. removeColumnDefinition(index: number): Grid;
  1392. /**
  1393. * Remove a row definition at specified index
  1394. * @param index defines the index of the row to remove
  1395. * @returns the current grid
  1396. */
  1397. removeRowDefinition(index: number): Grid;
  1398. /**
  1399. * Adds a new control to the current grid
  1400. * @param control defines the control to add
  1401. * @param row defines the row where to add the control (0 by default)
  1402. * @param column defines the column where to add the control (0 by default)
  1403. * @returns the current grid
  1404. */
  1405. addControl(control: Control, row?: number, column?: number): Grid;
  1406. /**
  1407. * Removes a control from the current container
  1408. * @param control defines the control to remove
  1409. * @returns the current container
  1410. */
  1411. removeControl(control: Control): Container;
  1412. /**
  1413. * Creates a new Grid
  1414. * @param name defines control name
  1415. */
  1416. constructor(name?: string | undefined);
  1417. protected _getTypeName(): string;
  1418. protected _getGridDefinitions(definitionCallback: (lefts: number[], tops: number[], widths: number[], heights: number[]) => void): void;
  1419. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1420. _flagDescendantsAsMatrixDirty(): void;
  1421. protected _renderHighlightSpecific(context: CanvasRenderingContext2D): void;
  1422. /** Releases associated resources */
  1423. dispose(): void;
  1424. }
  1425. }
  1426. declare module BABYLON.GUI {
  1427. /**
  1428. * Class used to create 2D images
  1429. */
  1430. export class Image extends Control {
  1431. name?: string | undefined;
  1432. /**
  1433. * BABYLON.Observable notified when the content is loaded
  1434. */
  1435. onImageLoadedObservable: BABYLON.Observable<Image>;
  1436. /**
  1437. * Gets a boolean indicating that the content is loaded
  1438. */
  1439. readonly isLoaded: boolean;
  1440. /**
  1441. * Gets or sets the left coordinate in the source image
  1442. */
  1443. sourceLeft: number;
  1444. /**
  1445. * Gets or sets the top coordinate in the source image
  1446. */
  1447. sourceTop: number;
  1448. /**
  1449. * Gets or sets the width to capture in the source image
  1450. */
  1451. sourceWidth: number;
  1452. /**
  1453. * Gets or sets the height to capture in the source image
  1454. */
  1455. sourceHeight: number;
  1456. /**
  1457. * Gets or sets a boolean indicating if the image can force its container to adapt its size
  1458. * @see http://doc.babylonjs.com/how_to/gui#image
  1459. */
  1460. autoScale: boolean;
  1461. /** Gets or sets the streching mode used by the image */
  1462. stretch: number;
  1463. /**
  1464. * Gets or sets the internal DOM image used to render the control
  1465. */
  1466. domImage: HTMLImageElement;
  1467. /**
  1468. * Gets or sets image source url
  1469. */
  1470. source: BABYLON.Nullable<string>;
  1471. /**
  1472. * Gets or sets the cell width to use when animation sheet is enabled
  1473. * @see http://doc.babylonjs.com/how_to/gui#image
  1474. */
  1475. cellWidth: number;
  1476. /**
  1477. * Gets or sets the cell height to use when animation sheet is enabled
  1478. * @see http://doc.babylonjs.com/how_to/gui#image
  1479. */
  1480. cellHeight: number;
  1481. /**
  1482. * Gets or sets the cell id to use (this will turn on the animation sheet mode)
  1483. * @see http://doc.babylonjs.com/how_to/gui#image
  1484. */
  1485. cellId: number;
  1486. /**
  1487. * Creates a new Image
  1488. * @param name defines the control name
  1489. * @param url defines the image url
  1490. */
  1491. constructor(name?: string | undefined, url?: BABYLON.Nullable<string>);
  1492. protected _getTypeName(): string;
  1493. /** Force the control to synchronize with its content */
  1494. synchronizeSizeWithContent(): void;
  1495. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1496. dispose(): void;
  1497. /** STRETCH_NONE */
  1498. static readonly STRETCH_NONE: number;
  1499. /** STRETCH_FILL */
  1500. static readonly STRETCH_FILL: number;
  1501. /** STRETCH_UNIFORM */
  1502. static readonly STRETCH_UNIFORM: number;
  1503. /** STRETCH_EXTEND */
  1504. static readonly STRETCH_EXTEND: number;
  1505. }
  1506. }
  1507. declare module BABYLON.GUI {
  1508. /**
  1509. * Class used to create input text control
  1510. */
  1511. export class InputText extends Control implements IFocusableControl {
  1512. name?: string | undefined;
  1513. /** @hidden */
  1514. _connectedVirtualKeyboard: BABYLON.Nullable<VirtualKeyboard>;
  1515. /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */
  1516. promptMessage: string;
  1517. /** BABYLON.Observable raised when the text changes */
  1518. onTextChangedObservable: BABYLON.Observable<InputText>;
  1519. /** BABYLON.Observable raised just before an entered character is to be added */
  1520. onBeforeKeyAddObservable: BABYLON.Observable<InputText>;
  1521. /** BABYLON.Observable raised when the control gets the focus */
  1522. onFocusObservable: BABYLON.Observable<InputText>;
  1523. /** BABYLON.Observable raised when the control loses the focus */
  1524. onBlurObservable: BABYLON.Observable<InputText>;
  1525. /**Observable raised when the text is highlighted */
  1526. onTextHighlightObservable: BABYLON.Observable<InputText>;
  1527. /**Observable raised when copy event is triggered */
  1528. onTextCopyObservable: BABYLON.Observable<InputText>;
  1529. /** BABYLON.Observable raised when cut event is triggered */
  1530. onTextCutObservable: BABYLON.Observable<InputText>;
  1531. /** BABYLON.Observable raised when paste event is triggered */
  1532. onTextPasteObservable: BABYLON.Observable<InputText>;
  1533. /** Gets or sets the maximum width allowed by the control */
  1534. maxWidth: string | number;
  1535. /** Gets the maximum width allowed by the control in pixels */
  1536. readonly maxWidthInPixels: number;
  1537. /** Gets or sets the text highlighter transparency; default: 0.4 */
  1538. highligherOpacity: number;
  1539. /** Gets or sets a boolean indicating whether to select complete text by default on input focus */
  1540. onFocusSelectAll: boolean;
  1541. /** Gets or sets the text hightlight color */
  1542. textHighlightColor: string;
  1543. /** Gets or sets control margin */
  1544. margin: string;
  1545. /** Gets control margin in pixels */
  1546. readonly marginInPixels: number;
  1547. /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */
  1548. autoStretchWidth: boolean;
  1549. /** Gets or sets border thickness */
  1550. thickness: number;
  1551. /** Gets or sets the background color when focused */
  1552. focusedBackground: string;
  1553. /** Gets or sets the background color */
  1554. background: string;
  1555. /** Gets or sets the placeholder color */
  1556. placeholderColor: string;
  1557. /** Gets or sets the text displayed when the control is empty */
  1558. placeholderText: string;
  1559. /** Gets or sets the dead key flag */
  1560. deadKey: boolean;
  1561. /** Gets or sets the highlight text */
  1562. highlightedText: string;
  1563. /** Gets or sets if the current key should be added */
  1564. addKey: boolean;
  1565. /** Gets or sets the value of the current key being entered */
  1566. currentKey: string;
  1567. /** Gets or sets the text displayed in the control */
  1568. text: string;
  1569. /** Gets or sets control width */
  1570. width: string | number;
  1571. /**
  1572. * Creates a new InputText
  1573. * @param name defines the control name
  1574. * @param text defines the text of the control
  1575. */
  1576. constructor(name?: string | undefined, text?: string);
  1577. /** @hidden */
  1578. onBlur(): void;
  1579. /** @hidden */
  1580. onFocus(): void;
  1581. protected _getTypeName(): string;
  1582. /**
  1583. * Function called to get the list of controls that should not steal the focus from this control
  1584. * @returns an array of controls
  1585. */
  1586. keepsFocusWith(): BABYLON.Nullable<Control[]>;
  1587. /** @hidden */
  1588. processKey(keyCode: number, key?: string, evt?: KeyboardEvent): void;
  1589. /**
  1590. * Handles the keyboard event
  1591. * @param evt Defines the KeyboardEvent
  1592. */
  1593. processKeyboard(evt: KeyboardEvent): void;
  1594. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1595. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1596. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  1597. protected _beforeRenderText(text: string): string;
  1598. dispose(): void;
  1599. }
  1600. }
  1601. declare module BABYLON.GUI {
  1602. /**
  1603. * Class used to create a password control
  1604. */
  1605. export class InputPassword extends InputText {
  1606. protected _beforeRenderText(text: string): string;
  1607. }
  1608. }
  1609. declare module BABYLON.GUI {
  1610. /** Class used to render 2D lines */
  1611. export class Line extends Control {
  1612. name?: string | undefined;
  1613. /** Gets or sets the dash pattern */
  1614. dash: Array<number>;
  1615. /** Gets or sets the control connected with the line end */
  1616. connectedControl: Control;
  1617. /** Gets or sets start coordinates on X axis */
  1618. x1: string | number;
  1619. /** Gets or sets start coordinates on Y axis */
  1620. y1: string | number;
  1621. /** Gets or sets end coordinates on X axis */
  1622. x2: string | number;
  1623. /** Gets or sets end coordinates on Y axis */
  1624. y2: string | number;
  1625. /** Gets or sets line width */
  1626. lineWidth: number;
  1627. /** Gets or sets horizontal alignment */
  1628. horizontalAlignment: number;
  1629. /** Gets or sets vertical alignment */
  1630. verticalAlignment: number;
  1631. /**
  1632. * Creates a new Line
  1633. * @param name defines the control name
  1634. */
  1635. constructor(name?: string | undefined);
  1636. protected _getTypeName(): string;
  1637. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1638. _measure(): void;
  1639. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1640. /**
  1641. * Move one end of the line given 3D cartesian coordinates.
  1642. * @param position Targeted world position
  1643. * @param scene BABYLON.Scene
  1644. * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
  1645. */
  1646. moveToVector3(position: BABYLON.Vector3, scene: BABYLON.Scene, end?: boolean): void;
  1647. /**
  1648. * Move one end of the line to a position in screen absolute space.
  1649. * @param projectedPosition Position in screen absolute space (X, Y)
  1650. * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
  1651. */
  1652. _moveToProjectedPosition(projectedPosition: BABYLON.Vector3, end?: boolean): void;
  1653. }
  1654. }
  1655. declare module BABYLON.GUI {
  1656. /**
  1657. * Class used to create multi line control
  1658. */
  1659. export class MultiLine extends Control {
  1660. name?: string | undefined;
  1661. /**
  1662. * Creates a new MultiLine
  1663. * @param name defines the control name
  1664. */
  1665. constructor(name?: string | undefined);
  1666. /** Gets or sets dash pattern */
  1667. dash: Array<number>;
  1668. /**
  1669. * Gets point stored at specified index
  1670. * @param index defines the index to look for
  1671. * @returns the requested point if found
  1672. */
  1673. getAt(index: number): MultiLinePoint;
  1674. /** Function called when a point is updated */
  1675. onPointUpdate: () => void;
  1676. /**
  1677. * Adds new points to the point collection
  1678. * @param items defines the list of items (mesh, control or 2d coordiantes) to add
  1679. * @returns the list of created MultiLinePoint
  1680. */
  1681. add(...items: (AbstractMesh | Control | {
  1682. x: string | number;
  1683. y: string | number;
  1684. })[]): MultiLinePoint[];
  1685. /**
  1686. * Adds a new point to the point collection
  1687. * @param item defines the item (mesh, control or 2d coordiantes) to add
  1688. * @returns the created MultiLinePoint
  1689. */
  1690. push(item?: (AbstractMesh | Control | {
  1691. x: string | number;
  1692. y: string | number;
  1693. })): MultiLinePoint;
  1694. /**
  1695. * Remove a specific value or point from the active point collection
  1696. * @param value defines the value or point to remove
  1697. */
  1698. remove(value: number | MultiLinePoint): void;
  1699. /**
  1700. * Resets this object to initial state (no point)
  1701. */
  1702. reset(): void;
  1703. /**
  1704. * Resets all links
  1705. */
  1706. resetLinks(): void;
  1707. /** Gets or sets line width */
  1708. lineWidth: number;
  1709. horizontalAlignment: number;
  1710. verticalAlignment: number;
  1711. protected _getTypeName(): string;
  1712. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1713. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1714. _measure(): void;
  1715. protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1716. dispose(): void;
  1717. }
  1718. }
  1719. declare module BABYLON.GUI {
  1720. /**
  1721. * Class used to create radio button controls
  1722. */
  1723. export class RadioButton extends Control {
  1724. name?: string | undefined;
  1725. /** Gets or sets border thickness */
  1726. thickness: number;
  1727. /** Gets or sets group name */
  1728. group: string;
  1729. /** BABYLON.Observable raised when isChecked is changed */
  1730. onIsCheckedChangedObservable: BABYLON.Observable<boolean>;
  1731. /** Gets or sets a value indicating the ratio between overall size and check size */
  1732. checkSizeRatio: number;
  1733. /** Gets or sets background color */
  1734. background: string;
  1735. /** Gets or sets a boolean indicating if the checkbox is checked or not */
  1736. isChecked: boolean;
  1737. /**
  1738. * Creates a new RadioButton
  1739. * @param name defines the control name
  1740. */
  1741. constructor(name?: string | undefined);
  1742. protected _getTypeName(): string;
  1743. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1744. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  1745. /**
  1746. * Utility function to easily create a radio button with a header
  1747. * @param title defines the label to use for the header
  1748. * @param group defines the group to use for the radio button
  1749. * @param isChecked defines the initial state of the radio button
  1750. * @param onValueChanged defines the callback to call when value changes
  1751. * @returns a StackPanel containing the radio button and a textBlock
  1752. */
  1753. static AddRadioButtonWithHeader(title: string, group: string, isChecked: boolean, onValueChanged: (button: RadioButton, value: boolean) => void): StackPanel;
  1754. }
  1755. }
  1756. declare module BABYLON.GUI {
  1757. /**
  1758. * Class used to create a 2D stack panel container
  1759. */
  1760. export class StackPanel extends Container {
  1761. name?: string | undefined;
  1762. /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
  1763. isVertical: boolean;
  1764. /**
  1765. * Gets or sets panel width.
  1766. * This value should not be set when in horizontal mode as it will be computed automatically
  1767. */
  1768. width: string | number;
  1769. /**
  1770. * Gets or sets panel height.
  1771. * This value should not be set when in vertical mode as it will be computed automatically
  1772. */
  1773. height: string | number;
  1774. /**
  1775. * Creates a new StackPanel
  1776. * @param name defines control name
  1777. */
  1778. constructor(name?: string | undefined);
  1779. protected _getTypeName(): string;
  1780. protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  1781. }
  1782. }
  1783. declare module BABYLON.GUI {
  1784. /** Class used to create a RadioGroup
  1785. * which contains groups of radio buttons
  1786. */
  1787. export class SelectorGroup {
  1788. /** name of SelectorGroup */
  1789. name: string;
  1790. /**
  1791. * Creates a new SelectorGroup
  1792. * @param name of group, used as a group heading
  1793. */
  1794. constructor(
  1795. /** name of SelectorGroup */
  1796. name: string);
  1797. /** Gets the groupPanel of the SelectorGroup */
  1798. readonly groupPanel: StackPanel;
  1799. /** Gets the selectors array */
  1800. readonly selectors: StackPanel[];
  1801. /** Gets and sets the group header */
  1802. header: string;
  1803. /** @hidden*/
  1804. _getSelector(selectorNb: number): StackPanel | undefined;
  1805. /** Removes the selector at the given position
  1806. * @param selectorNb the position of the selector within the group
  1807. */
  1808. removeSelector(selectorNb: number): void;
  1809. }
  1810. /** Class used to create a CheckboxGroup
  1811. * which contains groups of checkbox buttons
  1812. */
  1813. export class CheckboxGroup extends SelectorGroup {
  1814. /** Adds a checkbox as a control
  1815. * @param text is the label for the selector
  1816. * @param func is the function called when the Selector is checked
  1817. * @param checked is true when Selector is checked
  1818. */
  1819. addCheckbox(text: string, func?: (s: boolean) => void, checked?: boolean): void;
  1820. /** @hidden */
  1821. _setSelectorLabel(selectorNb: number, label: string): void;
  1822. /** @hidden */
  1823. _setSelectorLabelColor(selectorNb: number, color: string): void;
  1824. /** @hidden */
  1825. _setSelectorButtonColor(selectorNb: number, color: string): void;
  1826. /** @hidden */
  1827. _setSelectorButtonBackground(selectorNb: number, color: string): void;
  1828. }
  1829. /** Class used to create a RadioGroup
  1830. * which contains groups of radio buttons
  1831. */
  1832. export class RadioGroup extends SelectorGroup {
  1833. /** Adds a radio button as a control
  1834. * @param label is the label for the selector
  1835. * @param func is the function called when the Selector is checked
  1836. * @param checked is true when Selector is checked
  1837. */
  1838. addRadio(label: string, func?: (n: number) => void, checked?: boolean): void;
  1839. /** @hidden */
  1840. _setSelectorLabel(selectorNb: number, label: string): void;
  1841. /** @hidden */
  1842. _setSelectorLabelColor(selectorNb: number, color: string): void;
  1843. /** @hidden */
  1844. _setSelectorButtonColor(selectorNb: number, color: string): void;
  1845. /** @hidden */
  1846. _setSelectorButtonBackground(selectorNb: number, color: string): void;
  1847. }
  1848. /** Class used to create a SliderGroup
  1849. * which contains groups of slider buttons
  1850. */
  1851. export class SliderGroup extends SelectorGroup {
  1852. /**
  1853. * Adds a slider to the SelectorGroup
  1854. * @param label is the label for the SliderBar
  1855. * @param func is the function called when the Slider moves
  1856. * @param unit is a string describing the units used, eg degrees or metres
  1857. * @param min is the minimum value for the Slider
  1858. * @param max is the maximum value for the Slider
  1859. * @param value is the start value for the Slider between min and max
  1860. * @param onValueChange is the function used to format the value displayed, eg radians to degrees
  1861. */
  1862. addSlider(label: string, func?: (v: number) => void, unit?: string, min?: number, max?: number, value?: number, onValueChange?: (v: number) => number): void;
  1863. /** @hidden */
  1864. _setSelectorLabel(selectorNb: number, label: string): void;
  1865. /** @hidden */
  1866. _setSelectorLabelColor(selectorNb: number, color: string): void;
  1867. /** @hidden */
  1868. _setSelectorButtonColor(selectorNb: number, color: string): void;
  1869. /** @hidden */
  1870. _setSelectorButtonBackground(selectorNb: number, color: string): void;
  1871. }
  1872. /** Class used to hold the controls for the checkboxes, radio buttons and sliders
  1873. * @see http://doc.babylonjs.com/how_to/selector
  1874. */
  1875. export class SelectionPanel extends Rectangle {
  1876. /** name of SelectionPanel */
  1877. name: string;
  1878. /** an array of SelectionGroups */
  1879. groups: SelectorGroup[];
  1880. /**
  1881. * Creates a new SelectionPanel
  1882. * @param name of SelectionPanel
  1883. * @param groups is an array of SelectionGroups
  1884. */
  1885. constructor(
  1886. /** name of SelectionPanel */
  1887. name: string,
  1888. /** an array of SelectionGroups */
  1889. groups?: SelectorGroup[]);
  1890. protected _getTypeName(): string;
  1891. /** Gets or sets the headerColor */
  1892. headerColor: string;
  1893. /** Gets or sets the button color */
  1894. buttonColor: string;
  1895. /** Gets or sets the label color */
  1896. labelColor: string;
  1897. /** Gets or sets the button background */
  1898. buttonBackground: string;
  1899. /** Gets or sets the color of separator bar */
  1900. barColor: string;
  1901. /** Gets or sets the height of separator bar */
  1902. barHeight: string;
  1903. /** Gets or sets the height of spacers*/
  1904. spacerHeight: string;
  1905. /** Add a group to the selection panel
  1906. * @param group is the selector group to add
  1907. */
  1908. addGroup(group: SelectorGroup): void;
  1909. /** Remove the group from the given position
  1910. * @param groupNb is the position of the group in the list
  1911. */
  1912. removeGroup(groupNb: number): void;
  1913. /** Change a group header label
  1914. * @param label is the new group header label
  1915. * @param groupNb is the number of the group to relabel
  1916. * */
  1917. setHeaderName(label: string, groupNb: number): void;
  1918. /** Change selector label to the one given
  1919. * @param label is the new selector label
  1920. * @param groupNb is the number of the groupcontaining the selector
  1921. * @param selectorNb is the number of the selector within a group to relabel
  1922. * */
  1923. relabel(label: string, groupNb: number, selectorNb: number): void;
  1924. /** For a given group position remove the selector at the given position
  1925. * @param groupNb is the number of the group to remove the selector from
  1926. * @param selectorNb is the number of the selector within the group
  1927. */
  1928. removeFromGroupSelector(groupNb: number, selectorNb: number): void;
  1929. /** For a given group position of correct type add a checkbox button
  1930. * @param groupNb is the number of the group to remove the selector from
  1931. * @param label is the label for the selector
  1932. * @param func is the function called when the Selector is checked
  1933. * @param checked is true when Selector is checked
  1934. */
  1935. addToGroupCheckbox(groupNb: number, label: string, func?: () => void, checked?: boolean): void;
  1936. /** For a given group position of correct type add a radio button
  1937. * @param groupNb is the number of the group to remove the selector from
  1938. * @param label is the label for the selector
  1939. * @param func is the function called when the Selector is checked
  1940. * @param checked is true when Selector is checked
  1941. */
  1942. addToGroupRadio(groupNb: number, label: string, func?: () => void, checked?: boolean): void;
  1943. /**
  1944. * For a given slider group add a slider
  1945. * @param groupNb is the number of the group to add the slider to
  1946. * @param label is the label for the Slider
  1947. * @param func is the function called when the Slider moves
  1948. * @param unit is a string describing the units used, eg degrees or metres
  1949. * @param min is the minimum value for the Slider
  1950. * @param max is the maximum value for the Slider
  1951. * @param value is the start value for the Slider between min and max
  1952. * @param onVal is the function used to format the value displayed, eg radians to degrees
  1953. */
  1954. addToGroupSlider(groupNb: number, label: string, func?: () => void, unit?: string, min?: number, max?: number, value?: number, onVal?: (v: number) => number): void;
  1955. }
  1956. }
  1957. declare module BABYLON.GUI {
  1958. /**
  1959. * Class used to hold a viewer window and sliders in a grid
  1960. */
  1961. export class ScrollViewer extends Rectangle {
  1962. /** name of ScrollViewer */
  1963. name?: string | undefined;
  1964. /**
  1965. * Adds windowContents to the grid view window
  1966. * @param windowContents the contents to add the grid view window
  1967. */
  1968. addToWindow(windowContents: Control): void;
  1969. /**
  1970. * Gets or sets a value indicating the padding to use on the left of the viewer window
  1971. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1972. */
  1973. paddingLeft: string | number;
  1974. /**
  1975. * Gets a value indicating the padding in pixels to use on the left of the viewer window
  1976. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1977. */
  1978. readonly paddingLeftInPixels: number;
  1979. /**
  1980. * Gets or sets a value indicating the padding to use on the right of the viewer window
  1981. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1982. */
  1983. paddingRight: string | number;
  1984. /**
  1985. * Gets a value indicating the padding in pixels to use on the right of the viewer window
  1986. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1987. */
  1988. readonly paddingRightInPixels: number;
  1989. /**
  1990. * Gets or sets a value indicating the padding to use on the top of the viewer window
  1991. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1992. */
  1993. paddingTop: string | number;
  1994. /**
  1995. * Gets a value indicating the padding in pixels to use on the top of the viewer window
  1996. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  1997. */
  1998. readonly paddingTopInPixels: number;
  1999. /**
  2000. * Gets or sets a value indicating the padding to use on the bottom of the viewer window
  2001. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  2002. */
  2003. paddingBottom: string | number;
  2004. /**
  2005. * Gets a value indicating the padding in pixels to use on the bottom of the viewer window
  2006. * @see http://doc.babylonjs.com/how_to/gui#position-and-size
  2007. */
  2008. readonly paddingBottomInPixels: number;
  2009. /**
  2010. * Creates a new ScrollViewer
  2011. * @param name of ScrollViewer
  2012. */
  2013. constructor(
  2014. /** name of ScrollViewer */
  2015. name?: string | undefined);
  2016. /**
  2017. * Gets or sets the mouse wheel precision
  2018. * from 0 to 1 with a default value of 0.05
  2019. * */
  2020. wheelPrecision: number;
  2021. /** Gets or sets the bar color */
  2022. barColor: string;
  2023. /** Gets or sets the bar color */
  2024. barBorderColor: string;
  2025. /** Gets or sets the bar background */
  2026. barBackground: string;
  2027. /** @hidden */
  2028. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2029. }
  2030. }
  2031. declare module BABYLON.GUI {
  2032. /**
  2033. * Enum that determines the text-wrapping mode to use.
  2034. */
  2035. export enum TextWrapping {
  2036. /**
  2037. * Clip the text when it's larger than Control.width; this is the default mode.
  2038. */
  2039. Clip = 0,
  2040. /**
  2041. * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.
  2042. */
  2043. WordWrap = 1,
  2044. /**
  2045. * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.
  2046. */
  2047. Ellipsis = 2
  2048. }
  2049. /**
  2050. * Class used to create text block control
  2051. */
  2052. export class TextBlock extends Control {
  2053. /**
  2054. * Defines the name of the control
  2055. */
  2056. name?: string | undefined;
  2057. /**
  2058. * An event triggered after the text is changed
  2059. */
  2060. onTextChangedObservable: BABYLON.Observable<TextBlock>;
  2061. /**
  2062. * An event triggered after the text was broken up into lines
  2063. */
  2064. onLinesReadyObservable: BABYLON.Observable<TextBlock>;
  2065. /**
  2066. * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
  2067. */
  2068. readonly lines: any[];
  2069. /**
  2070. * Gets or sets an boolean indicating that the TextBlock will be resized to fit container
  2071. */
  2072. resizeToFit: boolean;
  2073. /**
  2074. * Gets or sets a boolean indicating if text must be wrapped
  2075. */
  2076. textWrapping: TextWrapping | boolean;
  2077. /**
  2078. * Gets or sets text to display
  2079. */
  2080. text: string;
  2081. /**
  2082. * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
  2083. */
  2084. textHorizontalAlignment: number;
  2085. /**
  2086. * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
  2087. */
  2088. textVerticalAlignment: number;
  2089. /**
  2090. * Gets or sets line spacing value
  2091. */
  2092. lineSpacing: string | number;
  2093. /**
  2094. * Gets or sets outlineWidth of the text to display
  2095. */
  2096. outlineWidth: number;
  2097. /**
  2098. * Gets or sets outlineColor of the text to display
  2099. */
  2100. outlineColor: string;
  2101. /**
  2102. * Creates a new TextBlock object
  2103. * @param name defines the name of the control
  2104. * @param text defines the text to display (emptry string by default)
  2105. */
  2106. constructor(
  2107. /**
  2108. * Defines the name of the control
  2109. */
  2110. name?: string | undefined, text?: string);
  2111. protected _getTypeName(): string;
  2112. /** @hidden */
  2113. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2114. protected _applyStates(context: CanvasRenderingContext2D): void;
  2115. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2116. protected _breakLines(refWidth: number, context: CanvasRenderingContext2D): object[];
  2117. protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
  2118. protected _parseLineEllipsis(line: string | undefined, width: number, context: CanvasRenderingContext2D): object;
  2119. protected _parseLineWordWrap(line: string | undefined, width: number, context: CanvasRenderingContext2D): object[];
  2120. protected _renderLines(context: CanvasRenderingContext2D): void;
  2121. /**
  2122. * Given a width constraint applied on the text block, find the expected height
  2123. * @returns expected height
  2124. */
  2125. computeExpectedHeight(): number;
  2126. dispose(): void;
  2127. }
  2128. }
  2129. declare module BABYLON.GUI {
  2130. /**
  2131. * Class used to store key control properties
  2132. */
  2133. export class KeyPropertySet {
  2134. /** Width */
  2135. width?: string;
  2136. /** Height */
  2137. height?: string;
  2138. /** Left padding */
  2139. paddingLeft?: string;
  2140. /** Right padding */
  2141. paddingRight?: string;
  2142. /** Top padding */
  2143. paddingTop?: string;
  2144. /** Bottom padding */
  2145. paddingBottom?: string;
  2146. /** Foreground color */
  2147. color?: string;
  2148. /** Background color */
  2149. background?: string;
  2150. }
  2151. /**
  2152. * Class used to create virtual keyboard
  2153. */
  2154. export class VirtualKeyboard extends StackPanel {
  2155. /** BABYLON.Observable raised when a key is pressed */
  2156. onKeyPressObservable: BABYLON.Observable<string>;
  2157. /** Gets or sets default key button width */
  2158. defaultButtonWidth: string;
  2159. /** Gets or sets default key button height */
  2160. defaultButtonHeight: string;
  2161. /** Gets or sets default key button left padding */
  2162. defaultButtonPaddingLeft: string;
  2163. /** Gets or sets default key button right padding */
  2164. defaultButtonPaddingRight: string;
  2165. /** Gets or sets default key button top padding */
  2166. defaultButtonPaddingTop: string;
  2167. /** Gets or sets default key button bottom padding */
  2168. defaultButtonPaddingBottom: string;
  2169. /** Gets or sets default key button foreground color */
  2170. defaultButtonColor: string;
  2171. /** Gets or sets default key button background color */
  2172. defaultButtonBackground: string;
  2173. /** Gets or sets shift button foreground color */
  2174. shiftButtonColor: string;
  2175. /** Gets or sets shift button thickness*/
  2176. selectedShiftThickness: number;
  2177. /** Gets shift key state */
  2178. shiftState: number;
  2179. protected _getTypeName(): string;
  2180. /**
  2181. * Adds a new row of keys
  2182. * @param keys defines the list of keys to add
  2183. * @param propertySets defines the associated property sets
  2184. */
  2185. addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
  2186. /**
  2187. * Set the shift key to a specific state
  2188. * @param shiftState defines the new shift state
  2189. */
  2190. applyShiftState(shiftState: number): void;
  2191. /** Gets the input text control currently attached to the keyboard */
  2192. readonly connectedInputText: BABYLON.Nullable<InputText>;
  2193. /**
  2194. * Connects the keyboard with an input text control
  2195. *
  2196. * @param input defines the target control
  2197. */
  2198. connect(input: InputText): void;
  2199. /**
  2200. * Disconnects the keyboard from connected InputText controls
  2201. *
  2202. * @param input optionally defines a target control, otherwise all are disconnected
  2203. */
  2204. disconnect(input?: InputText): void;
  2205. /**
  2206. * Release all resources
  2207. */
  2208. dispose(): void;
  2209. /**
  2210. * Creates a new keyboard using a default layout
  2211. *
  2212. * @param name defines control name
  2213. * @returns a new VirtualKeyboard
  2214. */
  2215. static CreateDefaultLayout(name?: string): VirtualKeyboard;
  2216. }
  2217. }
  2218. declare module BABYLON.GUI {
  2219. /** Class used to create rectangle container */
  2220. export class Rectangle extends Container {
  2221. name?: string | undefined;
  2222. /** Gets or sets border thickness */
  2223. thickness: number;
  2224. /** Gets or sets the corner radius angle */
  2225. cornerRadius: number;
  2226. /**
  2227. * Creates a new Rectangle
  2228. * @param name defines the control name
  2229. */
  2230. constructor(name?: string | undefined);
  2231. protected _getTypeName(): string;
  2232. protected _localDraw(context: CanvasRenderingContext2D): void;
  2233. protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2234. protected _clipForChildren(context: CanvasRenderingContext2D): void;
  2235. }
  2236. }
  2237. declare module BABYLON.GUI {
  2238. /** Class used to render a grid */
  2239. export class DisplayGrid extends Control {
  2240. name?: string | undefined;
  2241. /** Gets or sets a boolean indicating if minor lines must be rendered (true by default)) */
  2242. displayMinorLines: boolean;
  2243. /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */
  2244. displayMajorLines: boolean;
  2245. /** Gets or sets background color (Black by default) */
  2246. background: string;
  2247. /** Gets or sets the width of each cell (20 by default) */
  2248. cellWidth: number;
  2249. /** Gets or sets the height of each cell (20 by default) */
  2250. cellHeight: number;
  2251. /** Gets or sets the tickness of minor lines (1 by default) */
  2252. minorLineTickness: number;
  2253. /** Gets or sets the color of minor lines (DarkGray by default) */
  2254. minorLineColor: string;
  2255. /** Gets or sets the tickness of major lines (2 by default) */
  2256. majorLineTickness: number;
  2257. /** Gets or sets the color of major lines (White by default) */
  2258. majorLineColor: string;
  2259. /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/
  2260. majorLineFrequency: number;
  2261. /**
  2262. * Creates a new GridDisplayRectangle
  2263. * @param name defines the control name
  2264. */
  2265. constructor(name?: string | undefined);
  2266. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2267. protected _getTypeName(): string;
  2268. }
  2269. }
  2270. declare module BABYLON.GUI {
  2271. /**
  2272. * Class used to create slider controls
  2273. */
  2274. export class BaseSlider extends Control {
  2275. name?: string | undefined;
  2276. protected _thumbWidth: ValueAndUnit;
  2277. protected _barOffset: ValueAndUnit;
  2278. protected _displayThumb: boolean;
  2279. protected _effectiveBarOffset: number;
  2280. protected _renderLeft: number;
  2281. protected _renderTop: number;
  2282. protected _renderWidth: number;
  2283. protected _renderHeight: number;
  2284. protected _backgroundBoxLength: number;
  2285. protected _backgroundBoxThickness: number;
  2286. protected _effectiveThumbThickness: number;
  2287. /** BABYLON.Observable raised when the sldier value changes */
  2288. onValueChangedObservable: BABYLON.Observable<number>;
  2289. /** Gets or sets a boolean indicating if the thumb must be rendered */
  2290. displayThumb: boolean;
  2291. /** Gets or sets main bar offset (ie. the margin applied to the value bar) */
  2292. barOffset: string | number;
  2293. /** Gets main bar offset in pixels*/
  2294. readonly barOffsetInPixels: number;
  2295. /** Gets or sets thumb width */
  2296. thumbWidth: string | number;
  2297. /** Gets thumb width in pixels */
  2298. readonly thumbWidthInPixels: number;
  2299. /** Gets or sets minimum value */
  2300. minimum: number;
  2301. /** Gets or sets maximum value */
  2302. maximum: number;
  2303. /** Gets or sets current value */
  2304. value: number;
  2305. /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */
  2306. isVertical: boolean;
  2307. /** Gets or sets a value indicating if the thumb can go over main bar extends */
  2308. isThumbClamped: boolean;
  2309. /**
  2310. * Creates a new BaseSlider
  2311. * @param name defines the control name
  2312. */
  2313. constructor(name?: string | undefined);
  2314. protected _getTypeName(): string;
  2315. protected _getThumbPosition(): number;
  2316. protected _getThumbThickness(type: string): number;
  2317. protected _prepareRenderingData(type: string): void;
  2318. _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
  2319. _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
  2320. _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  2321. }
  2322. }
  2323. declare module BABYLON.GUI {
  2324. /**
  2325. * Class used to create slider controls
  2326. */
  2327. export class Slider extends BaseSlider {
  2328. name?: string | undefined;
  2329. /** Gets or sets border color */
  2330. borderColor: string;
  2331. /** Gets or sets background color */
  2332. background: string;
  2333. /** Gets or sets a boolean indicating if the thumb should be round or square */
  2334. isThumbCircle: boolean;
  2335. /**
  2336. * Creates a new Slider
  2337. * @param name defines the control name
  2338. */
  2339. constructor(name?: string | undefined);
  2340. protected _getTypeName(): string;
  2341. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2342. }
  2343. }
  2344. declare module BABYLON.GUI {
  2345. /**
  2346. * Class used to create slider controls based on images
  2347. */
  2348. export class ImageBasedSlider extends BaseSlider {
  2349. name?: string | undefined;
  2350. displayThumb: boolean;
  2351. /**
  2352. * Gets or sets the image used to render the background
  2353. */
  2354. backgroundImage: Image;
  2355. /**
  2356. * Gets or sets the image used to render the value bar
  2357. */
  2358. valueBarImage: Image;
  2359. /**
  2360. * Gets or sets the image used to render the thumb
  2361. */
  2362. thumbImage: Image;
  2363. /**
  2364. * Creates a new ImageBasedSlider
  2365. * @param name defines the control name
  2366. */
  2367. constructor(name?: string | undefined);
  2368. protected _getTypeName(): string;
  2369. _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
  2370. }
  2371. }
  2372. declare module BABYLON.GUI {
  2373. /**
  2374. * Forcing an export so that this code will execute
  2375. * @hidden
  2376. */
  2377. const name = "Statics";
  2378. }
  2379. declare module BABYLON.GUI {
  2380. /**
  2381. * Class used as a root to all buttons
  2382. */
  2383. export class AbstractButton3D extends Control3D {
  2384. /**
  2385. * Creates a new button
  2386. * @param name defines the control name
  2387. */
  2388. constructor(name?: string);
  2389. protected _getTypeName(): string;
  2390. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2391. }
  2392. }
  2393. declare module BABYLON.GUI {
  2394. /**
  2395. * Class used to create a button in 3D
  2396. */
  2397. export class Button3D extends AbstractButton3D {
  2398. /** @hidden */
  2399. protected _currentMaterial: BABYLON.Material;
  2400. /**
  2401. * Gets or sets the texture resolution used to render content (512 by default)
  2402. */
  2403. contentResolution: BABYLON.int;
  2404. /**
  2405. * Gets or sets the texture scale ratio used to render content (2 by default)
  2406. */
  2407. contentScaleRatio: number;
  2408. protected _disposeFacadeTexture(): void;
  2409. protected _resetContent(): void;
  2410. /**
  2411. * Creates a new button
  2412. * @param name defines the control name
  2413. */
  2414. constructor(name?: string);
  2415. /**
  2416. * Gets or sets the GUI 2D content used to display the button's facade
  2417. */
  2418. content: Control;
  2419. /**
  2420. * Apply the facade texture (created from the content property).
  2421. * This function can be overloaded by child classes
  2422. * @param facadeTexture defines the AdvancedDynamicTexture to use
  2423. */
  2424. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  2425. protected _getTypeName(): string;
  2426. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2427. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2428. /**
  2429. * Releases all associated resources
  2430. */
  2431. dispose(): void;
  2432. }
  2433. }
  2434. declare module BABYLON.GUI {
  2435. /**
  2436. * Class used to create containers for controls
  2437. */
  2438. export class Container3D extends Control3D {
  2439. /**
  2440. * Gets the list of child controls
  2441. */
  2442. protected _children: Control3D[];
  2443. /**
  2444. * Gets the list of child controls
  2445. */
  2446. readonly children: Array<Control3D>;
  2447. /**
  2448. * Gets or sets a boolean indicating if the layout must be blocked (default is false).
  2449. * This is helpful to optimize layout operation when adding multiple children in a row
  2450. */
  2451. blockLayout: boolean;
  2452. /**
  2453. * Creates a new container
  2454. * @param name defines the container name
  2455. */
  2456. constructor(name?: string);
  2457. /**
  2458. * Force the container to update the layout. Please note that it will not take blockLayout property in account
  2459. * @returns the current container
  2460. */
  2461. updateLayout(): Container3D;
  2462. /**
  2463. * Gets a boolean indicating if the given control is in the children of this control
  2464. * @param control defines the control to check
  2465. * @returns true if the control is in the child list
  2466. */
  2467. containsControl(control: Control3D): boolean;
  2468. /**
  2469. * Adds a control to the children of this control
  2470. * @param control defines the control to add
  2471. * @returns the current container
  2472. */
  2473. addControl(control: Control3D): Container3D;
  2474. /**
  2475. * This function will be called everytime a new control is added
  2476. */
  2477. protected _arrangeChildren(): void;
  2478. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  2479. /**
  2480. * Removes a control from the children of this control
  2481. * @param control defines the control to remove
  2482. * @returns the current container
  2483. */
  2484. removeControl(control: Control3D): Container3D;
  2485. protected _getTypeName(): string;
  2486. /**
  2487. * Releases all associated resources
  2488. */
  2489. dispose(): void;
  2490. /** Control rotation will remain unchanged */
  2491. static readonly UNSET_ORIENTATION: number;
  2492. /** Control will rotate to make it look at sphere central axis */
  2493. static readonly FACEORIGIN_ORIENTATION: number;
  2494. /** Control will rotate to make it look back at sphere central axis */
  2495. static readonly FACEORIGINREVERSED_ORIENTATION: number;
  2496. /** Control will rotate to look at z axis (0, 0, 1) */
  2497. static readonly FACEFORWARD_ORIENTATION: number;
  2498. /** Control will rotate to look at negative z axis (0, 0, -1) */
  2499. static readonly FACEFORWARDREVERSED_ORIENTATION: number;
  2500. }
  2501. }
  2502. declare module BABYLON.GUI {
  2503. /**
  2504. * Class used as base class for controls
  2505. */
  2506. export class Control3D implements BABYLON.IDisposable, BABYLON.IBehaviorAware<Control3D> {
  2507. /** Defines the control name */
  2508. name?: string | undefined;
  2509. /** @hidden */
  2510. _host: GUI3DManager;
  2511. /** Gets or sets the control position in world space */
  2512. position: BABYLON.Vector3;
  2513. /** Gets or sets the control scaling in world space */
  2514. scaling: BABYLON.Vector3;
  2515. /** Callback used to start pointer enter animation */
  2516. pointerEnterAnimation: () => void;
  2517. /** Callback used to start pointer out animation */
  2518. pointerOutAnimation: () => void;
  2519. /** Callback used to start pointer down animation */
  2520. pointerDownAnimation: () => void;
  2521. /** Callback used to start pointer up animation */
  2522. pointerUpAnimation: () => void;
  2523. /**
  2524. * An event triggered when the pointer move over the control
  2525. */
  2526. onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector3>;
  2527. /**
  2528. * An event triggered when the pointer move out of the control
  2529. */
  2530. onPointerOutObservable: BABYLON.Observable<Control3D>;
  2531. /**
  2532. * An event triggered when the pointer taps the control
  2533. */
  2534. onPointerDownObservable: BABYLON.Observable<Vector3WithInfo>;
  2535. /**
  2536. * An event triggered when pointer is up
  2537. */
  2538. onPointerUpObservable: BABYLON.Observable<Vector3WithInfo>;
  2539. /**
  2540. * An event triggered when a control is clicked on (with a mouse)
  2541. */
  2542. onPointerClickObservable: BABYLON.Observable<Vector3WithInfo>;
  2543. /**
  2544. * An event triggered when pointer enters the control
  2545. */
  2546. onPointerEnterObservable: BABYLON.Observable<Control3D>;
  2547. /**
  2548. * Gets or sets the parent container
  2549. */
  2550. parent: BABYLON.Nullable<Container3D>;
  2551. /**
  2552. * Gets the list of attached behaviors
  2553. * @see http://doc.babylonjs.com/features/behaviour
  2554. */
  2555. readonly behaviors: BABYLON.Behavior<Control3D>[];
  2556. /**
  2557. * Attach a behavior to the control
  2558. * @see http://doc.babylonjs.com/features/behaviour
  2559. * @param behavior defines the behavior to attach
  2560. * @returns the current control
  2561. */
  2562. addBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  2563. /**
  2564. * Remove an attached behavior
  2565. * @see http://doc.babylonjs.com/features/behaviour
  2566. * @param behavior defines the behavior to attach
  2567. * @returns the current control
  2568. */
  2569. removeBehavior(behavior: BABYLON.Behavior<Control3D>): Control3D;
  2570. /**
  2571. * Gets an attached behavior by name
  2572. * @param name defines the name of the behavior to look for
  2573. * @see http://doc.babylonjs.com/features/behaviour
  2574. * @returns null if behavior was not found else the requested behavior
  2575. */
  2576. getBehaviorByName(name: string): BABYLON.Nullable<BABYLON.Behavior<Control3D>>;
  2577. /** Gets or sets a boolean indicating if the control is visible */
  2578. isVisible: boolean;
  2579. /**
  2580. * Creates a new control
  2581. * @param name defines the control name
  2582. */
  2583. constructor(
  2584. /** Defines the control name */
  2585. name?: string | undefined);
  2586. /**
  2587. * Gets a string representing the class name
  2588. */
  2589. readonly typeName: string;
  2590. /**
  2591. * Get the current class name of the control.
  2592. * @returns current class name
  2593. */
  2594. getClassName(): string;
  2595. protected _getTypeName(): string;
  2596. /**
  2597. * Gets the transform node used by this control
  2598. */
  2599. readonly node: BABYLON.Nullable<BABYLON.TransformNode>;
  2600. /**
  2601. * Gets the mesh used to render this control
  2602. */
  2603. readonly mesh: BABYLON.Nullable<BABYLON.AbstractMesh>;
  2604. /**
  2605. * Link the control as child of the given node
  2606. * @param node defines the node to link to. Use null to unlink the control
  2607. * @returns the current control
  2608. */
  2609. linkToTransformNode(node: BABYLON.Nullable<BABYLON.TransformNode>): Control3D;
  2610. /** @hidden **/
  2611. _prepareNode(scene: BABYLON.Scene): void;
  2612. /**
  2613. * Node creation.
  2614. * Can be overriden by children
  2615. * @param scene defines the scene where the node must be attached
  2616. * @returns the attached node or null if none. Must return a BABYLON.Mesh or BABYLON.AbstractMesh if there is an atttached visible object
  2617. */
  2618. protected _createNode(scene: BABYLON.Scene): BABYLON.Nullable<BABYLON.TransformNode>;
  2619. /**
  2620. * Affect a material to the given mesh
  2621. * @param mesh defines the mesh which will represent the control
  2622. */
  2623. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2624. /** @hidden */
  2625. _onPointerMove(target: Control3D, coordinates: BABYLON.Vector3): void;
  2626. /** @hidden */
  2627. _onPointerEnter(target: Control3D): boolean;
  2628. /** @hidden */
  2629. _onPointerOut(target: Control3D): void;
  2630. /** @hidden */
  2631. _onPointerDown(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2632. /** @hidden */
  2633. _onPointerUp(target: Control3D, coordinates: BABYLON.Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
  2634. /** @hidden */
  2635. forcePointerUp(pointerId?: BABYLON.Nullable<number>): void;
  2636. /** @hidden */
  2637. _processObservables(type: number, pickedPoint: BABYLON.Vector3, pointerId: number, buttonIndex: number): boolean;
  2638. /** @hidden */
  2639. _disposeNode(): void;
  2640. /**
  2641. * Releases all associated resources
  2642. */
  2643. dispose(): void;
  2644. }
  2645. }
  2646. declare module BABYLON.GUI {
  2647. /**
  2648. * Class used to create a container panel deployed on the surface of a cylinder
  2649. */
  2650. export class CylinderPanel extends VolumeBasedPanel {
  2651. /**
  2652. * Gets or sets the radius of the cylinder where to project controls (5 by default)
  2653. */
  2654. radius: BABYLON.float;
  2655. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2656. }
  2657. }
  2658. declare module BABYLON.GUI {
  2659. /**
  2660. * Class used to create a holographic button in 3D
  2661. */
  2662. export class HolographicButton extends Button3D {
  2663. /**
  2664. * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
  2665. */
  2666. tooltipText: BABYLON.Nullable<string>;
  2667. /**
  2668. * Gets or sets text for the button
  2669. */
  2670. text: string;
  2671. /**
  2672. * Gets or sets the image url for the button
  2673. */
  2674. imageUrl: string;
  2675. /**
  2676. * Gets the back material used by this button
  2677. */
  2678. readonly backMaterial: FluentMaterial;
  2679. /**
  2680. * Gets the front material used by this button
  2681. */
  2682. readonly frontMaterial: FluentMaterial;
  2683. /**
  2684. * Gets the plate material used by this button
  2685. */
  2686. readonly plateMaterial: BABYLON.StandardMaterial;
  2687. /**
  2688. * Gets a boolean indicating if this button shares its material with other HolographicButtons
  2689. */
  2690. readonly shareMaterials: boolean;
  2691. /**
  2692. * Creates a new button
  2693. * @param name defines the control name
  2694. */
  2695. constructor(name?: string, shareMaterials?: boolean);
  2696. protected _getTypeName(): string;
  2697. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2698. protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
  2699. protected _affectMaterial(mesh: BABYLON.Mesh): void;
  2700. /**
  2701. * Releases all associated resources
  2702. */
  2703. dispose(): void;
  2704. }
  2705. }
  2706. declare module BABYLON.GUI {
  2707. /**
  2708. * Class used to create an interactable object. It's a 3D button using a mesh coming from the current scene
  2709. */
  2710. export class MeshButton3D extends Button3D {
  2711. /** @hidden */
  2712. protected _currentMesh: BABYLON.Mesh;
  2713. /**
  2714. * Creates a new 3D button based on a mesh
  2715. * @param mesh mesh to become a 3D button
  2716. * @param name defines the control name
  2717. */
  2718. constructor(mesh: BABYLON.Mesh, name?: string);
  2719. protected _getTypeName(): string;
  2720. protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
  2721. protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
  2722. }
  2723. }
  2724. declare module BABYLON.GUI {
  2725. /**
  2726. * Class used to create a container panel deployed on the surface of a plane
  2727. */
  2728. export class PlanePanel extends VolumeBasedPanel {
  2729. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2730. }
  2731. }
  2732. declare module BABYLON.GUI {
  2733. /**
  2734. * Class used to create a container panel where items get randomized planar mapping
  2735. */
  2736. export class ScatterPanel extends VolumeBasedPanel {
  2737. /**
  2738. * Gets or sets the number of iteration to use to scatter the controls (100 by default)
  2739. */
  2740. iteration: BABYLON.float;
  2741. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2742. protected _finalProcessing(): void;
  2743. }
  2744. }
  2745. declare module BABYLON.GUI {
  2746. /**
  2747. * Class used to create a container panel deployed on the surface of a sphere
  2748. */
  2749. export class SpherePanel extends VolumeBasedPanel {
  2750. /**
  2751. * Gets or sets the radius of the sphere where to project controls (5 by default)
  2752. */
  2753. radius: BABYLON.float;
  2754. protected _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2755. }
  2756. }
  2757. declare module BABYLON.GUI {
  2758. /**
  2759. * Class used to create a stack panel in 3D on XY plane
  2760. */
  2761. export class StackPanel3D extends Container3D {
  2762. /**
  2763. * Gets or sets a boolean indicating if the stack panel is vertical or horizontal (horizontal by default)
  2764. */
  2765. isVertical: boolean;
  2766. /**
  2767. * Gets or sets the distance between elements
  2768. */
  2769. margin: number;
  2770. /**
  2771. * Creates new StackPanel
  2772. * @param isVertical
  2773. */
  2774. constructor(isVertical?: boolean);
  2775. protected _arrangeChildren(): void;
  2776. }
  2777. }
  2778. declare module BABYLON.GUI {
  2779. /**
  2780. * Abstract class used to create a container panel deployed on the surface of a volume
  2781. */
  2782. export abstract class VolumeBasedPanel extends Container3D {
  2783. protected _cellWidth: number;
  2784. protected _cellHeight: number;
  2785. /**
  2786. * Gets or sets the distance between elements
  2787. */
  2788. margin: number;
  2789. /**
  2790. * Gets or sets the orientation to apply to all controls (BABYLON.Container3D.FaceOriginReversedOrientation by default)
  2791. * | Value | Type | Description |
  2792. * | ----- | ----------------------------------- | ----------- |
  2793. * | 0 | UNSET_ORIENTATION | Control rotation will remain unchanged |
  2794. * | 1 | FACEORIGIN_ORIENTATION | Control will rotate to make it look at sphere central axis |
  2795. * | 2 | FACEORIGINREVERSED_ORIENTATION | Control will rotate to make it look back at sphere central axis |
  2796. * | 3 | FACEFORWARD_ORIENTATION | Control will rotate to look at z axis (0, 0, 1) |
  2797. * | 4 | FACEFORWARDREVERSED_ORIENTATION | Control will rotate to look at negative z axis (0, 0, -1) |
  2798. */
  2799. orientation: number;
  2800. /**
  2801. * Gets or sets the number of columns requested (10 by default).
  2802. * The panel will automatically compute the number of rows based on number of child controls.
  2803. */
  2804. columns: BABYLON.int;
  2805. /**
  2806. * Gets or sets a the number of rows requested.
  2807. * The panel will automatically compute the number of columns based on number of child controls.
  2808. */
  2809. rows: BABYLON.int;
  2810. /**
  2811. * Creates new VolumeBasedPanel
  2812. */
  2813. constructor();
  2814. protected _arrangeChildren(): void;
  2815. /** Child classes must implement this function to provide correct control positioning */
  2816. protected abstract _mapGridNode(control: Control3D, nodePosition: BABYLON.Vector3): void;
  2817. /** Child classes can implement this function to provide additional processing */
  2818. protected _finalProcessing(): void;
  2819. }
  2820. }
  2821. declare module BABYLON.GUI {
  2822. /** @hidden */
  2823. export class FluentMaterialDefines extends BABYLON.MaterialDefines {
  2824. INNERGLOW: boolean;
  2825. BORDER: boolean;
  2826. HOVERLIGHT: boolean;
  2827. TEXTURE: boolean;
  2828. constructor();
  2829. }
  2830. /**
  2831. * Class used to render controls with fluent desgin
  2832. */
  2833. export class FluentMaterial extends BABYLON.PushMaterial {
  2834. /**
  2835. * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
  2836. */
  2837. innerGlowColorIntensity: number;
  2838. /**
  2839. * Gets or sets the inner glow color (white by default)
  2840. */
  2841. innerGlowColor: BABYLON.Color3;
  2842. /**
  2843. * Gets or sets alpha value (default is 1.0)
  2844. */
  2845. alpha: number;
  2846. /**
  2847. * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
  2848. */
  2849. albedoColor: BABYLON.Color3;
  2850. /**
  2851. * Gets or sets a boolean indicating if borders must be rendered (default is false)
  2852. */
  2853. renderBorders: boolean;
  2854. /**
  2855. * Gets or sets border width (default is 0.5)
  2856. */
  2857. borderWidth: number;
  2858. /**
  2859. * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
  2860. */
  2861. edgeSmoothingValue: number;
  2862. /**
  2863. * Gets or sets the minimum value that can be applied to border width (default is 0.1)
  2864. */
  2865. borderMinValue: number;
  2866. /**
  2867. * Gets or sets a boolean indicating if hover light must be rendered (default is false)
  2868. */
  2869. renderHoverLight: boolean;
  2870. /**
  2871. * Gets or sets the radius used to render the hover light (default is 1.0)
  2872. */
  2873. hoverRadius: number;
  2874. /**
  2875. * Gets or sets the color used to render the hover light (default is BABYLON.Color4(0.3, 0.3, 0.3, 1.0))
  2876. */
  2877. hoverColor: BABYLON.Color4;
  2878. /**
  2879. * Gets or sets the hover light position in world space (default is BABYLON.Vector3.Zero())
  2880. */
  2881. hoverPosition: BABYLON.Vector3;
  2882. /** Gets or sets the texture to use for albedo color */
  2883. albedoTexture: BABYLON.Nullable<BABYLON.BaseTexture>;
  2884. /**
  2885. * Creates a new Fluent material
  2886. * @param name defines the name of the material
  2887. * @param scene defines the hosting scene
  2888. */
  2889. constructor(name: string, scene: BABYLON.Scene);
  2890. needAlphaBlending(): boolean;
  2891. needAlphaTesting(): boolean;
  2892. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  2893. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  2894. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  2895. getActiveTextures(): BABYLON.BaseTexture[];
  2896. hasTexture(texture: BABYLON.BaseTexture): boolean;
  2897. dispose(forceDisposeEffect?: boolean): void;
  2898. clone(name: string): FluentMaterial;
  2899. serialize(): any;
  2900. getClassName(): string;
  2901. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
  2902. }
  2903. }