@babylonjs/gui 5.0.0-beta.10 → 5.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -410,3 +410,4 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
410
410
  */
411
411
  scaleTo(width: number, height: number): void;
412
412
  }
413
+ export { IFocusableControl };
@@ -1 +1 @@
1
- {"version":3,"file":"advancedDynamicTexture.js","sourceRoot":"","sources":["../../../sourceES6/gui/src/2D/advancedDynamicTexture.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAY,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAU,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAA+B,iBAAiB,EAAmB,MAAM,sCAAsC,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAmB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAEnF,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,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,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/B,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;QAE5B,IAAI,eAAe,IAAI,WAAW,EAAE;YAChC,IAAM,QAAQ,GAAG,CAAC,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC,uBAAuB,EAAE,CAAC;YACvE,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,QAAQ,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,QAAQ,CAAC;SAC3C;QAED,SAAS;QACT,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;;OAGG;IACK,sCAAK,GAAZ,UAAa,KAAa;QACvB,iBAAM,KAAK,YAAC,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,wCAAO,GAAd,UAAe,KAAa,EAAE,MAAc;QACxC,iBAAM,OAAO,YAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAtrCD,uCAAuC;IACzB,iCAAU,GAAG,+BAA+B,CAAC;IAE3D,yIAAyI;IAC3H,4CAAqB,GAAG,IAAI,CAAC;IAmrC/C,6BAAC;CAAA,AAxrCD,CAA4C,cAAc,GAwrCzD;SAxrCY,sBAAsB","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { Observable, Observer } from \"@babylonjs/core/Misc/observable\";\nimport { Vector2, Vector3, Matrix } from \"@babylonjs/core/Maths/math.vector\";\nimport { Tools } from \"@babylonjs/core/Misc/tools\";\nimport { PointerInfoPre, PointerInfo, PointerEventTypes, PointerInfoBase } from \"@babylonjs/core/Events/pointerEvents\";\nimport { ClipboardEventTypes, ClipboardInfo } from \"@babylonjs/core/Events/clipboardEvents\";\nimport { KeyboardInfoPre, KeyboardEventTypes } from \"@babylonjs/core/Events/keyboardEvents\";\nimport { Camera } from \"@babylonjs/core/Cameras/camera\";\nimport { StandardMaterial } from \"@babylonjs/core/Materials/standardMaterial\";\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\nimport { DynamicTexture } from \"@babylonjs/core/Materials/Textures/dynamicTexture\";\nimport { AbstractMesh } from \"@babylonjs/core/Meshes/abstractMesh\";\nimport { Layer } from \"@babylonjs/core/Layers/layer\";\nimport { Engine } from \"@babylonjs/core/Engines/engine\";\nimport { Scene } from \"@babylonjs/core/scene\";\n\nimport { Container } from \"./controls/container\";\nimport { Control } from \"./controls/control\";\nimport { IFocusableControl } from \"./controls/focusableControl\";\nimport { Style } from \"./style\";\nimport { Measure } from \"./measure\";\nimport { Constants } from \"@babylonjs/core/Engines/constants\";\nimport { Viewport } from \"@babylonjs/core/Maths/math.viewport\";\nimport { Color3 } from \"@babylonjs/core/Maths/math.color\";\nimport { WebRequest } from \"@babylonjs/core/Misc/webRequest\";\nimport { IPointerEvent, IWheelEvent } from \"@babylonjs/core/Events/deviceInputEvents\";\nimport { RandomGUID } from \"@babylonjs/core/Misc/guid\";\n\n/**\n * Class used to create texture to support 2D GUI elements\n * @see https://doc.babylonjs.com/how_to/gui\n */\nexport class AdvancedDynamicTexture extends DynamicTexture {\n /** Define the Uurl to load snippets */\n public static SnippetUrl = \"https://snippet.babylonjs.com\";\n\n /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */\n public static AllowGPUOptimizations = true;\n\n /** Snippet ID if the content was created from the snippet server */\n public snippetId: string;\n\n private _isDirty = false;\n private _renderObserver: Nullable<Observer<Camera>>;\n private _resizeObserver: Nullable<Observer<Engine>>;\n private _preKeyboardObserver: Nullable<Observer<KeyboardInfoPre>>;\n private _pointerMoveObserver: Nullable<Observer<PointerInfoPre>>;\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\n private _canvasPointerOutObserver: Nullable<Observer<IPointerEvent>>;\n private _canvasBlurObserver: Nullable<Observer<Engine>>;\n private _background: string;\n /** @hidden */\n public _rootContainer = new Container(\"root\");\n /** @hidden */\n public _lastPickedControl: Control;\n /** @hidden */\n public _lastControlOver: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _lastControlDown: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _capturingControl: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _shouldBlockPointer: boolean;\n /** @hidden */\n public _layerToDispose: Nullable<Layer>;\n /** @hidden */\n public _linkedControls = new Array<Control>();\n private _isFullscreen = false;\n private _fullscreenViewport = new Viewport(0, 0, 1, 1);\n private _idealWidth = 0;\n private _idealHeight = 0;\n private _useSmallestIdeal: boolean = false;\n private _renderAtIdealSize = false;\n private _focusedControl: Nullable<IFocusableControl>;\n private _blockNextFocusCheck = false;\n private _renderScale = 1;\n private _rootElement: Nullable<HTMLElement>;\n private _cursorChanged = false;\n private _defaultMousePointerId = 0;\n\n /** @hidden */\n public _numLayoutCalls = 0;\n /** Gets the number of layout calls made the last time the ADT has been rendered */\n public get numLayoutCalls(): number {\n return this._numLayoutCalls;\n }\n\n /** @hidden */\n public _numRenderCalls = 0;\n /** Gets the number of render calls made the last time the ADT has been rendered */\n public get numRenderCalls(): number {\n return this._numRenderCalls;\n }\n\n /**\n * Define type to string to ensure compatibility across browsers\n * Safari doesn't support DataTransfer constructor\n */\n private _clipboardData: string = \"\";\n /**\n * Observable event triggered each time an clipboard event is received from the rendering canvas\n */\n public onClipboardObservable = new Observable<ClipboardInfo>();\n /**\n * Observable event triggered each time a pointer down is intercepted by a control\n */\n public onControlPickedObservable = new Observable<Control>();\n /**\n * Observable event triggered before layout is evaluated\n */\n public onBeginLayoutObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered after the layout was evaluated\n */\n public onEndLayoutObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered before the texture is rendered\n */\n public onBeginRenderObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered after the texture was rendered\n */\n public onEndRenderObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Gets or sets a boolean defining if alpha is stored as premultiplied\n */\n public premulAlpha = false;\n /**\n * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture\n */\n public applyYInversionOnUpdate = true;\n /**\n * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).\n * Useful when you want more antialiasing\n */\n public get renderScale(): number {\n return this._renderScale;\n }\n public set renderScale(value: number) {\n if (value === this._renderScale) {\n return;\n }\n this._renderScale = value;\n this._onResize();\n }\n /** Gets or sets the background color */\n public get background(): string {\n return this._background;\n }\n public set background(value: string) {\n if (this._background === value) {\n return;\n }\n this._background = value;\n this.markAsDirty();\n }\n /**\n * Gets or sets the ideal width used to design controls.\n * The GUI will then rescale everything accordingly\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealWidth(): number {\n return this._idealWidth;\n }\n public set idealWidth(value: number) {\n if (this._idealWidth === value) {\n return;\n }\n this._idealWidth = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets the ideal height used to design controls.\n * The GUI will then rescale everything accordingly\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealHeight(): number {\n return this._idealHeight;\n }\n public set idealHeight(value: number) {\n if (this._idealHeight === value) {\n return;\n }\n this._idealHeight = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get useSmallestIdeal(): boolean {\n return this._useSmallestIdeal;\n }\n public set useSmallestIdeal(value: boolean) {\n if (this._useSmallestIdeal === value) {\n return;\n }\n this._useSmallestIdeal = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if adaptive scaling must be used\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get renderAtIdealSize(): boolean {\n return this._renderAtIdealSize;\n }\n public set renderAtIdealSize(value: boolean) {\n if (this._renderAtIdealSize === value) {\n return;\n }\n this._renderAtIdealSize = value;\n this._onResize();\n }\n\n /**\n * Gets the ratio used when in \"ideal mode\"\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n * */\n public get idealRatio(): number {\n var rwidth: number = 0;\n var rheight: number = 0;\n\n if (this._idealWidth) {\n rwidth = this.getSize().width / this._idealWidth;\n }\n\n if (this._idealHeight) {\n rheight = this.getSize().height / this._idealHeight;\n }\n\n if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) {\n return window.innerWidth < window.innerHeight ? rwidth : rheight;\n }\n\n if (this._idealWidth) {\n // horizontal\n return rwidth;\n }\n\n if (this._idealHeight) {\n // vertical\n return rheight;\n }\n\n return 1;\n }\n\n /**\n * Gets the underlying layer used to render the texture when in fullscreen mode\n */\n public get layer(): Nullable<Layer> {\n return this._layerToDispose;\n }\n /**\n * Gets the root container control\n */\n public get rootContainer(): Container {\n return this._rootContainer;\n }\n /**\n * Returns an array containing the root container.\n * This is mostly used to let the Inspector introspects the ADT\n * @returns an array containing the rootContainer\n */\n public getChildren(): Array<Container> {\n return [this._rootContainer];\n }\n /**\n * Will return all controls that are inside this texture\n * @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\n * @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\n * @return all child controls\n */\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\n return this._rootContainer.getDescendants(directDescendantsOnly, predicate);\n }\n\n /**\n * Will return all controls with the given type name\n * @param typeName defines the type name to search for\n * @returns an array of all controls found\n */\n public getControlsByType(typeName: string): Control[] {\n return this._rootContainer.getDescendants(false, (control) => control.typeName === typeName);\n }\n\n /**\n * Will return the first control with the given name\n * @param name defines the name to search for\n * @return the first control found or null\n */\n public getControlByName(name: string): Nullable<Control> {\n return this._getControlByKey(\"name\", name);\n }\n\n private _getControlByKey(key: string, value: any): Nullable<Control> {\n return this._rootContainer.getDescendants().find((control) => control[key as keyof Control] === value) || null;\n }\n\n /**\n * Gets or sets the current focused control\n */\n public get focusedControl(): Nullable<IFocusableControl> {\n return this._focusedControl;\n }\n public set focusedControl(control: Nullable<IFocusableControl>) {\n if (this._focusedControl == control) {\n return;\n }\n if (this._focusedControl) {\n this._focusedControl.onBlur();\n }\n if (control) {\n control.onFocus();\n }\n this._focusedControl = control;\n }\n /**\n * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode\n */\n public get isForeground(): boolean {\n if (!this.layer) {\n return true;\n }\n return !this.layer.isBackground;\n }\n public set isForeground(value: boolean) {\n if (!this.layer) {\n return;\n }\n if (this.layer.isBackground === !value) {\n return;\n }\n this.layer.isBackground = !value;\n }\n /**\n * Gets or set information about clipboardData\n */\n public get clipboardData(): string {\n return this._clipboardData;\n }\n public set clipboardData(value: string) {\n this._clipboardData = value;\n }\n /**\n * Creates a new AdvancedDynamicTexture\n * @param name defines the name of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)\n * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n */\n constructor(name: string, width = 0, height = 0, scene?: Nullable<Scene>, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) {\n super(name, { width: width, height: height }, scene, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY);\n scene = this.getScene();\n if (!scene || !this._texture) {\n return;\n }\n this.applyYInversionOnUpdate = invertY;\n this._rootElement = scene.getEngine().getInputElement();\n this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));\n this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {\n if (!this._focusedControl) {\n return;\n }\n if (info.type === KeyboardEventTypes.KEYDOWN) {\n this._focusedControl.processKeyboard(info.event);\n }\n info.skipOnPointerObservable = true;\n });\n this._rootContainer._link(this);\n this.hasAlpha = true;\n if (!width || !height) {\n this._resizeObserver = scene.getEngine().onResizeObservable.add(() => this._onResize());\n this._onResize();\n }\n this._texture.isReady = true;\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"AdvancedDynamicTexture\"\n */\n public getClassName(): string {\n return \"AdvancedDynamicTexture\";\n }\n /**\n * Function used to execute a function on all controls\n * @param func defines the function to execute\n * @param container defines the container where controls belong. If null the root container will be used\n */\n public executeOnAllControls(func: (control: Control) => void, container?: Container) {\n if (!container) {\n container = this._rootContainer;\n }\n func(container);\n for (var child of container.children) {\n if ((<any>child).children) {\n this.executeOnAllControls(func, <Container>child);\n continue;\n }\n func(child);\n }\n }\n\n private _useInvalidateRectOptimization = true;\n\n /**\n * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on\n */\n public get useInvalidateRectOptimization(): boolean {\n return this._useInvalidateRectOptimization;\n }\n\n public set useInvalidateRectOptimization(value: boolean) {\n this._useInvalidateRectOptimization = value;\n }\n\n // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position\n private _invalidatedRectangle: Nullable<Measure> = null;\n /**\n * Invalidates a rectangle area on the gui texture\n * @param invalidMinX left most position of the rectangle to invalidate in the texture\n * @param invalidMinY top most position of the rectangle to invalidate in the texture\n * @param invalidMaxX right most position of the rectangle to invalidate in the texture\n * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture\n */\n public invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number) {\n if (!this._useInvalidateRectOptimization) {\n return;\n }\n if (!this._invalidatedRectangle) {\n this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);\n } else {\n // Compute intersection\n var maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));\n var maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));\n this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));\n this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));\n this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;\n this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;\n }\n }\n /**\n * Marks the texture as dirty forcing a complete update\n */\n public markAsDirty() {\n this._isDirty = true;\n }\n /**\n * Helper function used to create a new style\n * @returns a new style\n * @see https://doc.babylonjs.com/how_to/gui#styles\n */\n public createStyle(): Style {\n return new Style(this);\n }\n /**\n * Adds a new control to the root container\n * @param control defines the control to add\n * @returns the current texture\n */\n public addControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.addControl(control);\n return this;\n }\n /**\n * Removes a control from the root container\n * @param control defines the control to remove\n * @returns the current texture\n */\n public removeControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.removeControl(control);\n return this;\n }\n /**\n * Moves overlapped controls towards a position where it is not overlapping anymore.\n * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.\n * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups\n * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)\n * @param repelFactor how much is the control repelled by other controls\n */\n public moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep = 1, repelFactor = 1) {\n let controlsForGroup: Control[];\n if (Array.isArray(overlapGroup)) {\n controlsForGroup = overlapGroup;\n } else {\n const descendants = this.getDescendants(true);\n // get only the controls with an overlapGroup property set\n // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup\n controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup);\n }\n\n controlsForGroup.forEach((control1) => {\n let velocity = Vector2.Zero();\n const center = new Vector2(control1.centerX, control1.centerY);\n\n controlsForGroup.forEach((control2) => {\n if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {\n // if the two controls overlaps get a direction vector from one control's center to another control's center\n const diff = center.subtract(new Vector2(control2.centerX, control2.centerY));\n const diffLength = diff.length();\n\n if (diffLength > 0) {\n // calculate the velocity\n velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));\n }\n }\n });\n\n if (velocity.length() > 0) {\n // move the control along the direction vector away from the overlapping control\n velocity = velocity.normalize().scale(deltaStep * (control1.overlapDeltaMultiplier ?? 1));\n control1.linkOffsetXInPixels += velocity.x;\n control1.linkOffsetYInPixels += velocity.y;\n }\n });\n }\n /**\n * Release all resources\n */\n public dispose(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n this._rootElement = null;\n scene.onBeforeCameraRenderObservable.remove(this._renderObserver);\n if (this._resizeObserver) {\n scene.getEngine().onResizeObservable.remove(this._resizeObserver);\n }\n if (this._pointerMoveObserver) {\n scene.onPrePointerObservable.remove(this._pointerMoveObserver);\n }\n if (this._pointerObserver) {\n scene.onPointerObservable.remove(this._pointerObserver);\n }\n if (this._preKeyboardObserver) {\n scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);\n }\n if (this._canvasPointerOutObserver) {\n scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);\n }\n if (this._canvasBlurObserver) {\n scene.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver);\n }\n if (this._layerToDispose) {\n this._layerToDispose.texture = null;\n this._layerToDispose.dispose();\n this._layerToDispose = null;\n }\n this._rootContainer.dispose();\n this.onClipboardObservable.clear();\n this.onControlPickedObservable.clear();\n this.onBeginRenderObservable.clear();\n this.onEndRenderObservable.clear();\n this.onBeginLayoutObservable.clear();\n this.onEndLayoutObservable.clear();\n super.dispose();\n }\n private _onResize(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n // Check size\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n var renderWidth = engine.getRenderWidth() * this._renderScale;\n var renderHeight = engine.getRenderHeight() * this._renderScale;\n\n if (this._renderAtIdealSize) {\n if (this._idealWidth) {\n renderHeight = (renderHeight * this._idealWidth) / renderWidth;\n renderWidth = this._idealWidth;\n } else if (this._idealHeight) {\n renderWidth = (renderWidth * this._idealHeight) / renderHeight;\n renderHeight = this._idealHeight;\n }\n }\n if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {\n this.scaleTo(renderWidth, renderHeight);\n this.markAsDirty();\n if (this._idealWidth || this._idealHeight) {\n this._rootContainer._markAllAsDirty();\n }\n }\n this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);\n }\n /** @hidden */\n public _getGlobalViewport(): Viewport {\n var size = this.getSize();\n const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height);\n\n const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX));\n const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY));\n\n globalViewPort.x += (globalViewPort.width - targetX) / 2;\n globalViewPort.y += (globalViewPort.height - targetY) / 2;\n\n globalViewPort.width = targetX;\n globalViewPort.height = targetY;\n\n return globalViewPort;\n }\n /**\n * Get screen coordinates for a vector3\n * @param position defines the position to project\n * @param worldMatrix defines the world matrix to use\n * @returns the projected position\n */\n public getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2 {\n const result = this.getProjectedPositionWithZ(position, worldMatrix);\n return new Vector2(result.x, result.y);\n }\n\n /**\n * Get screen coordinates for a vector3\n * @param position defines the position to project\n * @param worldMatrix defines the world matrix to use\n * @returns the projected position with Z\n */\n public getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3 {\n var scene = this.getScene();\n if (!scene) {\n return Vector3.Zero();\n }\n var globalViewport = this._getGlobalViewport();\n var projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);\n return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);\n }\n\n private _checkUpdate(camera: Camera): void {\n if (this._layerToDispose) {\n if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {\n return;\n }\n }\n if (this._isFullscreen && this._linkedControls.length) {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var globalViewport = this._getGlobalViewport();\n for (let control of this._linkedControls) {\n if (!control.isVisible) {\n continue;\n }\n let mesh = control._linkedMesh as AbstractMesh;\n if (!mesh || mesh.isDisposed()) {\n Tools.SetImmediate(() => {\n control.linkWithMesh(null);\n });\n continue;\n }\n let position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : (Vector3.ZeroReadOnly as Vector3);\n let projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\n control.notRenderable = true;\n continue;\n }\n control.notRenderable = false;\n\n control._moveToProjectedPosition(projectedPosition);\n }\n }\n if (!this._isDirty && !this._rootContainer.isDirty) {\n return;\n }\n this._isDirty = false;\n this._render();\n this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations);\n }\n\n private _clearMeasure = new Measure(0, 0, 0, 0);\n\n private _render(): void {\n var textureSize = this.getSize();\n var renderWidth = textureSize.width;\n var renderHeight = textureSize.height;\n\n var context = this.getContext();\n context.font = \"18px Arial\";\n context.strokeStyle = \"white\";\n\n // Layout\n this.onBeginLayoutObservable.notifyObservers(this);\n var measure = new Measure(0, 0, renderWidth, renderHeight);\n this._numLayoutCalls = 0;\n this._rootContainer._layout(measure, context);\n this.onEndLayoutObservable.notifyObservers(this);\n this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing\n\n // Clear\n if (this._invalidatedRectangle) {\n this._clearMeasure.copyFrom(this._invalidatedRectangle);\n } else {\n this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);\n }\n context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n if (this._background) {\n context.save();\n context.fillStyle = this._background;\n context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n context.restore();\n }\n\n // Render\n this.onBeginRenderObservable.notifyObservers(this);\n this._numRenderCalls = 0;\n this._rootContainer._render(context, this._invalidatedRectangle);\n this.onEndRenderObservable.notifyObservers(this);\n this._invalidatedRectangle = null;\n }\n /** @hidden */\n public _changeCursor(cursor: string) {\n if (this._rootElement) {\n this._rootElement.style.cursor = cursor;\n this._cursorChanged = true;\n }\n }\n /** @hidden */\n public _registerLastControlDown(control: Control, pointerId: number) {\n this._lastControlDown[pointerId] = control;\n this.onControlPickedObservable.notifyObservers(control);\n }\n private _doPicking(x: number, y: number, pi: PointerInfoBase, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n if (this._isFullscreen) {\n let camera = scene.cameraToUseForPointers || scene.activeCamera;\n if (!camera) {\n return;\n }\n let viewport = camera.viewport;\n x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));\n y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));\n }\n if (this._capturingControl[pointerId]) {\n this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex);\n return;\n }\n\n this._cursorChanged = false;\n if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {\n if (!scene.doNotHandleCursors) {\n this._changeCursor(\"\");\n }\n if (type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi);\n delete this._lastControlOver[pointerId];\n }\n }\n }\n\n if (!this._cursorChanged && !scene.doNotHandleCursors) {\n this._changeCursor(\"\");\n }\n this._manageFocus();\n }\n /** @hidden */\n public _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control }, control: Control) {\n for (var pointerId in list) {\n if (!list.hasOwnProperty(pointerId)) {\n continue;\n }\n var lastControlOver = list[pointerId];\n if (lastControlOver === control) {\n delete list[pointerId];\n }\n }\n }\n /** @hidden */\n public _cleanControlAfterRemoval(control: Control) {\n this._cleanControlAfterRemovalFromList(this._lastControlDown, control);\n this._cleanControlAfterRemovalFromList(this._lastControlOver, control);\n }\n /** Attach to all scene events required to support pointer events */\n public attach(): void {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n\n let tempViewport = new Viewport(0, 0, 0, 0);\n\n this._pointerMoveObserver = scene.onPrePointerObservable.add((pi, state) => {\n if (scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId)) {\n return;\n }\n if (\n pi.type !== PointerEventTypes.POINTERMOVE &&\n pi.type !== PointerEventTypes.POINTERUP &&\n pi.type !== PointerEventTypes.POINTERDOWN &&\n pi.type !== PointerEventTypes.POINTERWHEEL\n ) {\n return;\n }\n\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\n }\n\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\n const engine = scene.getEngine();\n const originalCameraToUseForPointers = scene.cameraToUseForPointers;\n\n if (!camera) {\n tempViewport.x = 0;\n tempViewport.y = 0;\n tempViewport.width = engine.getRenderWidth();\n tempViewport.height = engine.getRenderHeight();\n } else {\n if (camera.rigCameras.length) {\n // rig camera - we need to find the camera to use for this event\n let rigViewport = new Viewport(0, 0, 1, 1);\n camera.rigCameras.forEach((rigCamera) => {\n // generate the viewport of this camera\n rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport);\n let x = scene.pointerX / engine.getHardwareScalingLevel() - rigViewport.x;\n let y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport.y - rigViewport.height);\n // check if the pointer is in the camera's viewport\n if (x < 0 || y < 0 || x > rigViewport.width || y > rigViewport.height) {\n // out of viewport - don't use this camera\n return;\n }\n // set the camera to use for pointers until this pointer loop is over\n scene.cameraToUseForPointers = rigCamera;\n // set the viewport\n tempViewport.x = rigViewport.x;\n tempViewport.y = rigViewport.y;\n tempViewport.width = rigViewport.width;\n tempViewport.height = rigViewport.height;\n });\n } else {\n camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);\n }\n }\n\n let x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;\n let y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);\n this._shouldBlockPointer = false;\n // Do picking modifies _shouldBlockPointer\n let pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\n this._doPicking(x, y, pi, pi.type, pointerId, pi.event.button, (<IWheelEvent>pi.event).deltaX, (<IWheelEvent>pi.event).deltaY);\n // Avoid overwriting a true skipOnPointerObservable to false\n if (this._shouldBlockPointer) {\n pi.skipOnPointerObservable = this._shouldBlockPointer;\n }\n // if overridden by a rig camera - reset back to the original value\n scene.cameraToUseForPointers = originalCameraToUseForPointers;\n });\n this._attachToOnPointerOut(scene);\n this._attachToOnBlur(scene);\n }\n\n /** @hidden */\n private onClipboardCopy = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /** @hidden */\n private onClipboardCut = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /** @hidden */\n private onClipboardPaste = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /**\n * Register the clipboard Events onto the canvas\n */\n public registerClipboardEvents(): void {\n self.addEventListener(\"copy\", this.onClipboardCopy, false);\n self.addEventListener(\"cut\", this.onClipboardCut, false);\n self.addEventListener(\"paste\", this.onClipboardPaste, false);\n }\n /**\n * Unregister the clipboard Events from the canvas\n */\n public unRegisterClipboardEvents(): void {\n self.removeEventListener(\"copy\", this.onClipboardCopy);\n self.removeEventListener(\"cut\", this.onClipboardCut);\n self.removeEventListener(\"paste\", this.onClipboardPaste);\n }\n /**\n * Connect the texture to a hosting mesh to enable interactions\n * @param mesh defines the mesh to attach to\n * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well\n */\n public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n this._pointerObserver = scene.onPointerObservable.add((pi, state) => {\n if (\n pi.type !== PointerEventTypes.POINTERMOVE &&\n pi.type !== PointerEventTypes.POINTERUP &&\n pi.type !== PointerEventTypes.POINTERDOWN &&\n pi.type !== PointerEventTypes.POINTERWHEEL\n ) {\n return;\n }\n\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\n }\n\n var pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\n if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {\n var uv = pi.pickInfo.getTextureCoordinates();\n if (uv) {\n let size = this.getSize();\n this._doPicking(\n uv.x * size.width,\n (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height,\n pi,\n pi.type,\n pointerId,\n pi.event.button,\n (<IWheelEvent>pi.event).deltaX,\n (<IWheelEvent>pi.event).deltaY\n );\n }\n } else if (pi.type === PointerEventTypes.POINTERUP) {\n if (this._lastControlDown[pointerId]) {\n this._lastControlDown[pointerId]._forcePointerUp(pointerId);\n }\n delete this._lastControlDown[pointerId];\n if (this.focusedControl) {\n const friendlyControls = this.focusedControl.keepsFocusWith();\n let canMoveFocus = true;\n if (friendlyControls) {\n for (var control of friendlyControls) {\n // Same host, no need to keep the focus\n if (this === control._host) {\n continue;\n }\n // Different hosts\n const otherHost = control._host;\n if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {\n canMoveFocus = false;\n break;\n }\n }\n }\n if (canMoveFocus) {\n this.focusedControl = null;\n }\n }\n } else if (pi.type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true);\n }\n delete this._lastControlOver[pointerId];\n }\n });\n mesh.enablePointerMoveEvents = supportPointerMove;\n this._attachToOnPointerOut(scene);\n this._attachToOnBlur(scene);\n }\n /**\n * Move the focus to a specific control\n * @param control defines the control which will receive the focus\n */\n public moveFocusToControl(control: IFocusableControl): void {\n this.focusedControl = control;\n this._lastPickedControl = <any>control;\n this._blockNextFocusCheck = true;\n }\n private _manageFocus(): void {\n if (this._blockNextFocusCheck) {\n this._blockNextFocusCheck = false;\n this._lastPickedControl = <any>this._focusedControl;\n return;\n }\n // Focus management\n if (this._focusedControl) {\n if (this._focusedControl !== <any>this._lastPickedControl) {\n if (this._lastPickedControl.isFocusInvisible) {\n return;\n }\n this.focusedControl = null;\n }\n }\n }\n private _attachToOnPointerOut(scene: Scene): void {\n this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => {\n if (this._lastControlOver[pointerEvent.pointerId]) {\n this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null);\n }\n delete this._lastControlOver[pointerEvent.pointerId];\n if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) {\n this._lastControlDown[pointerEvent.pointerId]._forcePointerUp();\n delete this._lastControlDown[pointerEvent.pointerId];\n }\n });\n }\n private _attachToOnBlur(scene: Scene): void {\n this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add((pointerEvent) => {\n Object.entries(this._lastControlDown).forEach(([key, value]) => {\n value._onCanvasBlur();\n });\n this.focusedControl = null;\n this._lastControlDown = {};\n });\n }\n\n /**\n * Serializes the entire GUI system\n * @returns an object with the JSON serialized data\n */\n public serializeContent(): any {\n const size = this.getSize();\n let serializationObject = {\n root: {},\n width: size.width,\n height: size.height,\n };\n\n this._rootContainer.serialize(serializationObject.root);\n\n return serializationObject;\n }\n\n /**\n * Recreate the content of the ADT from a JSON object\n * @param serializedObject define the JSON serialized object to restore from\n * @param scaleToSize defines whether to scale to texture to the saved size\n */\n public parseContent(serializedObject: any, scaleToSize?: boolean) {\n this._rootContainer = Control.Parse(serializedObject.root, this) as Container;\n if (scaleToSize) {\n const width = serializedObject.width;\n const height = serializedObject.height;\n if (typeof width === \"number\" && typeof height === \"number\" && width >= 0 && height >= 0) {\n this.scaleTo(width, height);\n } else {\n // scales the GUI to a default size if none was available in the serialized content\n this.scaleTo(1920, 1080);\n }\n }\n }\n\n /**\n * Recreate the content of the ADT from a snippet saved by the GUI editor\n * @param snippetId defines the snippet to load\n * @param scaleToSize defines whether to scale to texture to the saved size\n * @returns a promise that will resolve on success\n */\n public parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void> {\n if (snippetId === \"_BLANK\") {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n var request = new WebRequest();\n request.addEventListener(\"readystatechange\", () => {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\n let serializationObject = JSON.parse(snippet.gui);\n\n this.parseContent(serializationObject, scaleToSize);\n this.snippetId = snippetId;\n\n resolve();\n } else {\n reject(\"Unable to load the snippet \" + snippetId);\n }\n }\n });\n\n request.open(\"GET\", AdvancedDynamicTexture.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\n request.send();\n });\n }\n\n /**\n * Recreate the content of the ADT from a url json\n * @param url defines the url to load\n * @param scaleToSize defines whether to scale to texture to the saved size\n * @returns a promise that will resolve on success\n */\n public parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void> {\n if (url === \"\") {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n var request = new WebRequest();\n request.addEventListener(\"readystatechange\", () => {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var gui = request.responseText;\n let serializationObject = JSON.parse(gui);\n this.parseContent(serializationObject, scaleToSize);\n\n resolve();\n } else {\n reject(\"Unable to load\");\n }\n }\n });\n request.open(\"GET\", url);\n request.send();\n });\n }\n\n // Statics\n /**\n * Compares two rectangle based controls for pixel overlap\n * @param control1 The first control to compare\n * @param control2 The second control to compare\n * @returns true if overlaps, otherwise false\n */\n private static _Overlaps(control1: Control, control2: Control) {\n return !(\n control1.centerX > control2.centerX + control2.widthInPixels ||\n control1.centerX + control1.widthInPixels < control2.centerX ||\n control1.centerY + control1.heightInPixels < control2.centerY ||\n control1.centerY > control2.centerY + control2.heightInPixels\n );\n }\n\n /**\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)\n * @param mesh defines the mesh which will receive the texture\n * @param width defines the texture width (1024 by default)\n * @param height defines the texture height (1024 by default)\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\n * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateForMesh(mesh: AbstractMesh, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false, invertY?: boolean): AdvancedDynamicTexture {\n // use a unique ID in name so serialization will work even if you create two ADTs for a single mesh\n const uniqueId = RandomGUID();\n var result = new AdvancedDynamicTexture(`AdvancedDynamicTexture for ${mesh.name} [${uniqueId}]`, width, height, mesh.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY);\n var material = new StandardMaterial(`AdvancedDynamicTextureMaterial for ${mesh.name} [${uniqueId}]`, mesh.getScene());\n material.backFaceCulling = false;\n material.diffuseColor = Color3.Black();\n material.specularColor = Color3.Black();\n if (onlyAlphaTesting) {\n material.diffuseTexture = result;\n material.emissiveTexture = result;\n result.hasAlpha = true;\n } else {\n material.emissiveTexture = result;\n material.opacityTexture = result;\n }\n mesh.material = material;\n result.attachToMesh(mesh, supportPointerMove);\n return result;\n }\n\n /**\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture\n * @param mesh defines the mesh which will receive the texture\n * @param width defines the texture width (1024 by default)\n * @param height defines the texture height (1024 by default)\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateForMeshTexture(mesh: AbstractMesh, width = 1024, height = 1024, supportPointerMove = true, invertY?: boolean): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(mesh.name + \" AdvancedDynamicTexture\", width, height, mesh.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY);\n result.attachToMesh(mesh, supportPointerMove);\n return result;\n }\n /**\n * Creates a new AdvancedDynamicTexture in fullscreen mode.\n * In this mode the texture will rely on a layer for its rendering.\n * This allows it to be treated like any other layer.\n * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.\n * LayerMask is set through advancedTexture.layer.layerMask\n * @param name defines name for the texture\n * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)\n * @param scene defines the hosting scene\n * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)\n * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateFullscreenUI(name: string, foreground: boolean = true, scene: Nullable<Scene> = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling: boolean = false): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);\n // Display\n const resultScene = result.getScene();\n var layer = new Layer(name + \"_layer\", null, resultScene, !foreground);\n layer.texture = result;\n result._layerToDispose = layer;\n result._isFullscreen = true;\n\n if (adaptiveScaling && resultScene) {\n const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();\n result._rootContainer.scaleX = newScale;\n result._rootContainer.scaleY = newScale;\n }\n\n // Attach\n result.attach();\n return result;\n }\n\n /**\n * Scales the texture\n * @param ratio the scale factor to apply to both width and height\n */\n public scale(ratio: number): void {\n super.scale(ratio);\n this.markAsDirty();\n }\n\n /**\n * Resizes the texture\n * @param width the new width\n * @param height the new height\n */\n public scaleTo(width: number, height: number): void {\n super.scaleTo(width, height);\n this.markAsDirty();\n }\n}\n"]}
1
+ {"version":3,"file":"advancedDynamicTexture.js","sourceRoot":"","sources":["../../../sourceES6/gui/src/2D/advancedDynamicTexture.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAY,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAU,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAA+B,iBAAiB,EAAmB,MAAM,sCAAsC,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAmB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAEnF,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIrD,OA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nullable } from \"@babylonjs/core/types\";\nimport { Observable, Observer } from \"@babylonjs/core/Misc/observable\";\nimport { Vector2, Vector3, Matrix } from \"@babylonjs/core/Maths/math.vector\";\nimport { Tools } from \"@babylonjs/core/Misc/tools\";\nimport { PointerInfoPre, PointerInfo, PointerEventTypes, PointerInfoBase } from \"@babylonjs/core/Events/pointerEvents\";\nimport { ClipboardEventTypes, ClipboardInfo } from \"@babylonjs/core/Events/clipboardEvents\";\nimport { KeyboardInfoPre, KeyboardEventTypes } from \"@babylonjs/core/Events/keyboardEvents\";\nimport { Camera } from \"@babylonjs/core/Cameras/camera\";\nimport { StandardMaterial } from \"@babylonjs/core/Materials/standardMaterial\";\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\nimport { DynamicTexture } from \"@babylonjs/core/Materials/Textures/dynamicTexture\";\nimport { AbstractMesh } from \"@babylonjs/core/Meshes/abstractMesh\";\nimport { Layer } from \"@babylonjs/core/Layers/layer\";\nimport { Engine } from \"@babylonjs/core/Engines/engine\";\nimport { Scene } from \"@babylonjs/core/scene\";\n\nimport { Container } from \"./controls/container\";\nimport { Control } from \"./controls/control\";\nimport { IFocusableControl } from \"./controls/focusableControl\";\nimport { Style } from \"./style\";\nimport { Measure } from \"./measure\";\nimport { Constants } from \"@babylonjs/core/Engines/constants\";\nimport { Viewport } from \"@babylonjs/core/Maths/math.viewport\";\nimport { Color3 } from \"@babylonjs/core/Maths/math.color\";\nimport { WebRequest } from \"@babylonjs/core/Misc/webRequest\";\nimport { IPointerEvent, IWheelEvent } from \"@babylonjs/core/Events/deviceInputEvents\";\nimport { RandomGUID } from \"@babylonjs/core/Misc/guid\";\n\n/**\n * Class used to create texture to support 2D GUI elements\n * @see https://doc.babylonjs.com/how_to/gui\n */\nexport class AdvancedDynamicTexture extends DynamicTexture {\n /** Define the Uurl to load snippets */\n public static SnippetUrl = \"https://snippet.babylonjs.com\";\n\n /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */\n public static AllowGPUOptimizations = true;\n\n /** Snippet ID if the content was created from the snippet server */\n public snippetId: string;\n\n private _isDirty = false;\n private _renderObserver: Nullable<Observer<Camera>>;\n private _resizeObserver: Nullable<Observer<Engine>>;\n private _preKeyboardObserver: Nullable<Observer<KeyboardInfoPre>>;\n private _pointerMoveObserver: Nullable<Observer<PointerInfoPre>>;\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\n private _canvasPointerOutObserver: Nullable<Observer<IPointerEvent>>;\n private _canvasBlurObserver: Nullable<Observer<Engine>>;\n private _background: string;\n /** @hidden */\n public _rootContainer = new Container(\"root\");\n /** @hidden */\n public _lastPickedControl: Control;\n /** @hidden */\n public _lastControlOver: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _lastControlDown: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _capturingControl: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _shouldBlockPointer: boolean;\n /** @hidden */\n public _layerToDispose: Nullable<Layer>;\n /** @hidden */\n public _linkedControls = new Array<Control>();\n private _isFullscreen = false;\n private _fullscreenViewport = new Viewport(0, 0, 1, 1);\n private _idealWidth = 0;\n private _idealHeight = 0;\n private _useSmallestIdeal: boolean = false;\n private _renderAtIdealSize = false;\n private _focusedControl: Nullable<IFocusableControl>;\n private _blockNextFocusCheck = false;\n private _renderScale = 1;\n private _rootElement: Nullable<HTMLElement>;\n private _cursorChanged = false;\n private _defaultMousePointerId = 0;\n\n /** @hidden */\n public _numLayoutCalls = 0;\n /** Gets the number of layout calls made the last time the ADT has been rendered */\n public get numLayoutCalls(): number {\n return this._numLayoutCalls;\n }\n\n /** @hidden */\n public _numRenderCalls = 0;\n /** Gets the number of render calls made the last time the ADT has been rendered */\n public get numRenderCalls(): number {\n return this._numRenderCalls;\n }\n\n /**\n * Define type to string to ensure compatibility across browsers\n * Safari doesn't support DataTransfer constructor\n */\n private _clipboardData: string = \"\";\n /**\n * Observable event triggered each time an clipboard event is received from the rendering canvas\n */\n public onClipboardObservable = new Observable<ClipboardInfo>();\n /**\n * Observable event triggered each time a pointer down is intercepted by a control\n */\n public onControlPickedObservable = new Observable<Control>();\n /**\n * Observable event triggered before layout is evaluated\n */\n public onBeginLayoutObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered after the layout was evaluated\n */\n public onEndLayoutObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered before the texture is rendered\n */\n public onBeginRenderObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Observable event triggered after the texture was rendered\n */\n public onEndRenderObservable = new Observable<AdvancedDynamicTexture>();\n /**\n * Gets or sets a boolean defining if alpha is stored as premultiplied\n */\n public premulAlpha = false;\n /**\n * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture\n */\n public applyYInversionOnUpdate = true;\n /**\n * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).\n * Useful when you want more antialiasing\n */\n public get renderScale(): number {\n return this._renderScale;\n }\n public set renderScale(value: number) {\n if (value === this._renderScale) {\n return;\n }\n this._renderScale = value;\n this._onResize();\n }\n /** Gets or sets the background color */\n public get background(): string {\n return this._background;\n }\n public set background(value: string) {\n if (this._background === value) {\n return;\n }\n this._background = value;\n this.markAsDirty();\n }\n /**\n * Gets or sets the ideal width used to design controls.\n * The GUI will then rescale everything accordingly\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealWidth(): number {\n return this._idealWidth;\n }\n public set idealWidth(value: number) {\n if (this._idealWidth === value) {\n return;\n }\n this._idealWidth = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets the ideal height used to design controls.\n * The GUI will then rescale everything accordingly\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealHeight(): number {\n return this._idealHeight;\n }\n public set idealHeight(value: number) {\n if (this._idealHeight === value) {\n return;\n }\n this._idealHeight = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get useSmallestIdeal(): boolean {\n return this._useSmallestIdeal;\n }\n public set useSmallestIdeal(value: boolean) {\n if (this._useSmallestIdeal === value) {\n return;\n }\n this._useSmallestIdeal = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if adaptive scaling must be used\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get renderAtIdealSize(): boolean {\n return this._renderAtIdealSize;\n }\n public set renderAtIdealSize(value: boolean) {\n if (this._renderAtIdealSize === value) {\n return;\n }\n this._renderAtIdealSize = value;\n this._onResize();\n }\n\n /**\n * Gets the ratio used when in \"ideal mode\"\n * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling\n * */\n public get idealRatio(): number {\n var rwidth: number = 0;\n var rheight: number = 0;\n\n if (this._idealWidth) {\n rwidth = this.getSize().width / this._idealWidth;\n }\n\n if (this._idealHeight) {\n rheight = this.getSize().height / this._idealHeight;\n }\n\n if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) {\n return window.innerWidth < window.innerHeight ? rwidth : rheight;\n }\n\n if (this._idealWidth) {\n // horizontal\n return rwidth;\n }\n\n if (this._idealHeight) {\n // vertical\n return rheight;\n }\n\n return 1;\n }\n\n /**\n * Gets the underlying layer used to render the texture when in fullscreen mode\n */\n public get layer(): Nullable<Layer> {\n return this._layerToDispose;\n }\n /**\n * Gets the root container control\n */\n public get rootContainer(): Container {\n return this._rootContainer;\n }\n /**\n * Returns an array containing the root container.\n * This is mostly used to let the Inspector introspects the ADT\n * @returns an array containing the rootContainer\n */\n public getChildren(): Array<Container> {\n return [this._rootContainer];\n }\n /**\n * Will return all controls that are inside this texture\n * @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\n * @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\n * @return all child controls\n */\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\n return this._rootContainer.getDescendants(directDescendantsOnly, predicate);\n }\n\n /**\n * Will return all controls with the given type name\n * @param typeName defines the type name to search for\n * @returns an array of all controls found\n */\n public getControlsByType(typeName: string): Control[] {\n return this._rootContainer.getDescendants(false, (control) => control.typeName === typeName);\n }\n\n /**\n * Will return the first control with the given name\n * @param name defines the name to search for\n * @return the first control found or null\n */\n public getControlByName(name: string): Nullable<Control> {\n return this._getControlByKey(\"name\", name);\n }\n\n private _getControlByKey(key: string, value: any): Nullable<Control> {\n return this._rootContainer.getDescendants().find((control) => control[key as keyof Control] === value) || null;\n }\n\n /**\n * Gets or sets the current focused control\n */\n public get focusedControl(): Nullable<IFocusableControl> {\n return this._focusedControl;\n }\n public set focusedControl(control: Nullable<IFocusableControl>) {\n if (this._focusedControl == control) {\n return;\n }\n if (this._focusedControl) {\n this._focusedControl.onBlur();\n }\n if (control) {\n control.onFocus();\n }\n this._focusedControl = control;\n }\n /**\n * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode\n */\n public get isForeground(): boolean {\n if (!this.layer) {\n return true;\n }\n return !this.layer.isBackground;\n }\n public set isForeground(value: boolean) {\n if (!this.layer) {\n return;\n }\n if (this.layer.isBackground === !value) {\n return;\n }\n this.layer.isBackground = !value;\n }\n /**\n * Gets or set information about clipboardData\n */\n public get clipboardData(): string {\n return this._clipboardData;\n }\n public set clipboardData(value: string) {\n this._clipboardData = value;\n }\n /**\n * Creates a new AdvancedDynamicTexture\n * @param name defines the name of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)\n * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n */\n constructor(name: string, width = 0, height = 0, scene?: Nullable<Scene>, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) {\n super(name, { width: width, height: height }, scene, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY);\n scene = this.getScene();\n if (!scene || !this._texture) {\n return;\n }\n this.applyYInversionOnUpdate = invertY;\n this._rootElement = scene.getEngine().getInputElement();\n this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));\n this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {\n if (!this._focusedControl) {\n return;\n }\n if (info.type === KeyboardEventTypes.KEYDOWN) {\n this._focusedControl.processKeyboard(info.event);\n }\n info.skipOnPointerObservable = true;\n });\n this._rootContainer._link(this);\n this.hasAlpha = true;\n if (!width || !height) {\n this._resizeObserver = scene.getEngine().onResizeObservable.add(() => this._onResize());\n this._onResize();\n }\n this._texture.isReady = true;\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"AdvancedDynamicTexture\"\n */\n public getClassName(): string {\n return \"AdvancedDynamicTexture\";\n }\n /**\n * Function used to execute a function on all controls\n * @param func defines the function to execute\n * @param container defines the container where controls belong. If null the root container will be used\n */\n public executeOnAllControls(func: (control: Control) => void, container?: Container) {\n if (!container) {\n container = this._rootContainer;\n }\n func(container);\n for (var child of container.children) {\n if ((<any>child).children) {\n this.executeOnAllControls(func, <Container>child);\n continue;\n }\n func(child);\n }\n }\n\n private _useInvalidateRectOptimization = true;\n\n /**\n * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on\n */\n public get useInvalidateRectOptimization(): boolean {\n return this._useInvalidateRectOptimization;\n }\n\n public set useInvalidateRectOptimization(value: boolean) {\n this._useInvalidateRectOptimization = value;\n }\n\n // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position\n private _invalidatedRectangle: Nullable<Measure> = null;\n /**\n * Invalidates a rectangle area on the gui texture\n * @param invalidMinX left most position of the rectangle to invalidate in the texture\n * @param invalidMinY top most position of the rectangle to invalidate in the texture\n * @param invalidMaxX right most position of the rectangle to invalidate in the texture\n * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture\n */\n public invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number) {\n if (!this._useInvalidateRectOptimization) {\n return;\n }\n if (!this._invalidatedRectangle) {\n this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);\n } else {\n // Compute intersection\n var maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));\n var maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));\n this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));\n this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));\n this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;\n this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;\n }\n }\n /**\n * Marks the texture as dirty forcing a complete update\n */\n public markAsDirty() {\n this._isDirty = true;\n }\n /**\n * Helper function used to create a new style\n * @returns a new style\n * @see https://doc.babylonjs.com/how_to/gui#styles\n */\n public createStyle(): Style {\n return new Style(this);\n }\n /**\n * Adds a new control to the root container\n * @param control defines the control to add\n * @returns the current texture\n */\n public addControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.addControl(control);\n return this;\n }\n /**\n * Removes a control from the root container\n * @param control defines the control to remove\n * @returns the current texture\n */\n public removeControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.removeControl(control);\n return this;\n }\n /**\n * Moves overlapped controls towards a position where it is not overlapping anymore.\n * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.\n * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups\n * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)\n * @param repelFactor how much is the control repelled by other controls\n */\n public moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep = 1, repelFactor = 1) {\n let controlsForGroup: Control[];\n if (Array.isArray(overlapGroup)) {\n controlsForGroup = overlapGroup;\n } else {\n const descendants = this.getDescendants(true);\n // get only the controls with an overlapGroup property set\n // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup\n controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup);\n }\n\n controlsForGroup.forEach((control1) => {\n let velocity = Vector2.Zero();\n const center = new Vector2(control1.centerX, control1.centerY);\n\n controlsForGroup.forEach((control2) => {\n if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {\n // if the two controls overlaps get a direction vector from one control's center to another control's center\n const diff = center.subtract(new Vector2(control2.centerX, control2.centerY));\n const diffLength = diff.length();\n\n if (diffLength > 0) {\n // calculate the velocity\n velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));\n }\n }\n });\n\n if (velocity.length() > 0) {\n // move the control along the direction vector away from the overlapping control\n velocity = velocity.normalize().scale(deltaStep * (control1.overlapDeltaMultiplier ?? 1));\n control1.linkOffsetXInPixels += velocity.x;\n control1.linkOffsetYInPixels += velocity.y;\n }\n });\n }\n /**\n * Release all resources\n */\n public dispose(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n this._rootElement = null;\n scene.onBeforeCameraRenderObservable.remove(this._renderObserver);\n if (this._resizeObserver) {\n scene.getEngine().onResizeObservable.remove(this._resizeObserver);\n }\n if (this._pointerMoveObserver) {\n scene.onPrePointerObservable.remove(this._pointerMoveObserver);\n }\n if (this._pointerObserver) {\n scene.onPointerObservable.remove(this._pointerObserver);\n }\n if (this._preKeyboardObserver) {\n scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);\n }\n if (this._canvasPointerOutObserver) {\n scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);\n }\n if (this._canvasBlurObserver) {\n scene.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver);\n }\n if (this._layerToDispose) {\n this._layerToDispose.texture = null;\n this._layerToDispose.dispose();\n this._layerToDispose = null;\n }\n this._rootContainer.dispose();\n this.onClipboardObservable.clear();\n this.onControlPickedObservable.clear();\n this.onBeginRenderObservable.clear();\n this.onEndRenderObservable.clear();\n this.onBeginLayoutObservable.clear();\n this.onEndLayoutObservable.clear();\n super.dispose();\n }\n private _onResize(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n // Check size\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n var renderWidth = engine.getRenderWidth() * this._renderScale;\n var renderHeight = engine.getRenderHeight() * this._renderScale;\n\n if (this._renderAtIdealSize) {\n if (this._idealWidth) {\n renderHeight = (renderHeight * this._idealWidth) / renderWidth;\n renderWidth = this._idealWidth;\n } else if (this._idealHeight) {\n renderWidth = (renderWidth * this._idealHeight) / renderHeight;\n renderHeight = this._idealHeight;\n }\n }\n if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {\n this.scaleTo(renderWidth, renderHeight);\n this.markAsDirty();\n if (this._idealWidth || this._idealHeight) {\n this._rootContainer._markAllAsDirty();\n }\n }\n this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);\n }\n /** @hidden */\n public _getGlobalViewport(): Viewport {\n var size = this.getSize();\n const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height);\n\n const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX));\n const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY));\n\n globalViewPort.x += (globalViewPort.width - targetX) / 2;\n globalViewPort.y += (globalViewPort.height - targetY) / 2;\n\n globalViewPort.width = targetX;\n globalViewPort.height = targetY;\n\n return globalViewPort;\n }\n /**\n * Get screen coordinates for a vector3\n * @param position defines the position to project\n * @param worldMatrix defines the world matrix to use\n * @returns the projected position\n */\n public getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2 {\n const result = this.getProjectedPositionWithZ(position, worldMatrix);\n return new Vector2(result.x, result.y);\n }\n\n /**\n * Get screen coordinates for a vector3\n * @param position defines the position to project\n * @param worldMatrix defines the world matrix to use\n * @returns the projected position with Z\n */\n public getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3 {\n var scene = this.getScene();\n if (!scene) {\n return Vector3.Zero();\n }\n var globalViewport = this._getGlobalViewport();\n var projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);\n return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);\n }\n\n private _checkUpdate(camera: Camera): void {\n if (this._layerToDispose) {\n if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {\n return;\n }\n }\n if (this._isFullscreen && this._linkedControls.length) {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var globalViewport = this._getGlobalViewport();\n for (let control of this._linkedControls) {\n if (!control.isVisible) {\n continue;\n }\n let mesh = control._linkedMesh as AbstractMesh;\n if (!mesh || mesh.isDisposed()) {\n Tools.SetImmediate(() => {\n control.linkWithMesh(null);\n });\n continue;\n }\n let position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : (Vector3.ZeroReadOnly as Vector3);\n let projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\n control.notRenderable = true;\n continue;\n }\n control.notRenderable = false;\n\n control._moveToProjectedPosition(projectedPosition);\n }\n }\n if (!this._isDirty && !this._rootContainer.isDirty) {\n return;\n }\n this._isDirty = false;\n this._render();\n this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations);\n }\n\n private _clearMeasure = new Measure(0, 0, 0, 0);\n\n private _render(): void {\n var textureSize = this.getSize();\n var renderWidth = textureSize.width;\n var renderHeight = textureSize.height;\n\n var context = this.getContext();\n context.font = \"18px Arial\";\n context.strokeStyle = \"white\";\n\n // Layout\n this.onBeginLayoutObservable.notifyObservers(this);\n var measure = new Measure(0, 0, renderWidth, renderHeight);\n this._numLayoutCalls = 0;\n this._rootContainer._layout(measure, context);\n this.onEndLayoutObservable.notifyObservers(this);\n this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing\n\n // Clear\n if (this._invalidatedRectangle) {\n this._clearMeasure.copyFrom(this._invalidatedRectangle);\n } else {\n this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);\n }\n context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n if (this._background) {\n context.save();\n context.fillStyle = this._background;\n context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n context.restore();\n }\n\n // Render\n this.onBeginRenderObservable.notifyObservers(this);\n this._numRenderCalls = 0;\n this._rootContainer._render(context, this._invalidatedRectangle);\n this.onEndRenderObservable.notifyObservers(this);\n this._invalidatedRectangle = null;\n }\n /** @hidden */\n public _changeCursor(cursor: string) {\n if (this._rootElement) {\n this._rootElement.style.cursor = cursor;\n this._cursorChanged = true;\n }\n }\n /** @hidden */\n public _registerLastControlDown(control: Control, pointerId: number) {\n this._lastControlDown[pointerId] = control;\n this.onControlPickedObservable.notifyObservers(control);\n }\n private _doPicking(x: number, y: number, pi: PointerInfoBase, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n if (this._isFullscreen) {\n let camera = scene.cameraToUseForPointers || scene.activeCamera;\n if (!camera) {\n return;\n }\n let viewport = camera.viewport;\n x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));\n y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));\n }\n if (this._capturingControl[pointerId]) {\n this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex);\n return;\n }\n\n this._cursorChanged = false;\n if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {\n if (!scene.doNotHandleCursors) {\n this._changeCursor(\"\");\n }\n if (type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi);\n delete this._lastControlOver[pointerId];\n }\n }\n }\n\n if (!this._cursorChanged && !scene.doNotHandleCursors) {\n this._changeCursor(\"\");\n }\n this._manageFocus();\n }\n /** @hidden */\n public _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control }, control: Control) {\n for (var pointerId in list) {\n if (!list.hasOwnProperty(pointerId)) {\n continue;\n }\n var lastControlOver = list[pointerId];\n if (lastControlOver === control) {\n delete list[pointerId];\n }\n }\n }\n /** @hidden */\n public _cleanControlAfterRemoval(control: Control) {\n this._cleanControlAfterRemovalFromList(this._lastControlDown, control);\n this._cleanControlAfterRemovalFromList(this._lastControlOver, control);\n }\n /** Attach to all scene events required to support pointer events */\n public attach(): void {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n\n let tempViewport = new Viewport(0, 0, 0, 0);\n\n this._pointerMoveObserver = scene.onPrePointerObservable.add((pi, state) => {\n if (scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId)) {\n return;\n }\n if (\n pi.type !== PointerEventTypes.POINTERMOVE &&\n pi.type !== PointerEventTypes.POINTERUP &&\n pi.type !== PointerEventTypes.POINTERDOWN &&\n pi.type !== PointerEventTypes.POINTERWHEEL\n ) {\n return;\n }\n\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\n }\n\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\n const engine = scene.getEngine();\n const originalCameraToUseForPointers = scene.cameraToUseForPointers;\n\n if (!camera) {\n tempViewport.x = 0;\n tempViewport.y = 0;\n tempViewport.width = engine.getRenderWidth();\n tempViewport.height = engine.getRenderHeight();\n } else {\n if (camera.rigCameras.length) {\n // rig camera - we need to find the camera to use for this event\n let rigViewport = new Viewport(0, 0, 1, 1);\n camera.rigCameras.forEach((rigCamera) => {\n // generate the viewport of this camera\n rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport);\n let x = scene.pointerX / engine.getHardwareScalingLevel() - rigViewport.x;\n let y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport.y - rigViewport.height);\n // check if the pointer is in the camera's viewport\n if (x < 0 || y < 0 || x > rigViewport.width || y > rigViewport.height) {\n // out of viewport - don't use this camera\n return;\n }\n // set the camera to use for pointers until this pointer loop is over\n scene.cameraToUseForPointers = rigCamera;\n // set the viewport\n tempViewport.x = rigViewport.x;\n tempViewport.y = rigViewport.y;\n tempViewport.width = rigViewport.width;\n tempViewport.height = rigViewport.height;\n });\n } else {\n camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);\n }\n }\n\n let x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;\n let y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);\n this._shouldBlockPointer = false;\n // Do picking modifies _shouldBlockPointer\n let pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\n this._doPicking(x, y, pi, pi.type, pointerId, pi.event.button, (<IWheelEvent>pi.event).deltaX, (<IWheelEvent>pi.event).deltaY);\n // Avoid overwriting a true skipOnPointerObservable to false\n if (this._shouldBlockPointer) {\n pi.skipOnPointerObservable = this._shouldBlockPointer;\n }\n // if overridden by a rig camera - reset back to the original value\n scene.cameraToUseForPointers = originalCameraToUseForPointers;\n });\n this._attachToOnPointerOut(scene);\n this._attachToOnBlur(scene);\n }\n\n /** @hidden */\n private onClipboardCopy = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /** @hidden */\n private onClipboardCut = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /** @hidden */\n private onClipboardPaste = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n };\n /**\n * Register the clipboard Events onto the canvas\n */\n public registerClipboardEvents(): void {\n self.addEventListener(\"copy\", this.onClipboardCopy, false);\n self.addEventListener(\"cut\", this.onClipboardCut, false);\n self.addEventListener(\"paste\", this.onClipboardPaste, false);\n }\n /**\n * Unregister the clipboard Events from the canvas\n */\n public unRegisterClipboardEvents(): void {\n self.removeEventListener(\"copy\", this.onClipboardCopy);\n self.removeEventListener(\"cut\", this.onClipboardCut);\n self.removeEventListener(\"paste\", this.onClipboardPaste);\n }\n /**\n * Connect the texture to a hosting mesh to enable interactions\n * @param mesh defines the mesh to attach to\n * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well\n */\n public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n this._pointerObserver = scene.onPointerObservable.add((pi, state) => {\n if (\n pi.type !== PointerEventTypes.POINTERMOVE &&\n pi.type !== PointerEventTypes.POINTERUP &&\n pi.type !== PointerEventTypes.POINTERDOWN &&\n pi.type !== PointerEventTypes.POINTERWHEEL\n ) {\n return;\n }\n\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\n }\n\n var pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\n if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {\n var uv = pi.pickInfo.getTextureCoordinates();\n if (uv) {\n let size = this.getSize();\n this._doPicking(\n uv.x * size.width,\n (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height,\n pi,\n pi.type,\n pointerId,\n pi.event.button,\n (<IWheelEvent>pi.event).deltaX,\n (<IWheelEvent>pi.event).deltaY\n );\n }\n } else if (pi.type === PointerEventTypes.POINTERUP) {\n if (this._lastControlDown[pointerId]) {\n this._lastControlDown[pointerId]._forcePointerUp(pointerId);\n }\n delete this._lastControlDown[pointerId];\n if (this.focusedControl) {\n const friendlyControls = this.focusedControl.keepsFocusWith();\n let canMoveFocus = true;\n if (friendlyControls) {\n for (var control of friendlyControls) {\n // Same host, no need to keep the focus\n if (this === control._host) {\n continue;\n }\n // Different hosts\n const otherHost = control._host;\n if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {\n canMoveFocus = false;\n break;\n }\n }\n }\n if (canMoveFocus) {\n this.focusedControl = null;\n }\n }\n } else if (pi.type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true);\n }\n delete this._lastControlOver[pointerId];\n }\n });\n mesh.enablePointerMoveEvents = supportPointerMove;\n this._attachToOnPointerOut(scene);\n this._attachToOnBlur(scene);\n }\n /**\n * Move the focus to a specific control\n * @param control defines the control which will receive the focus\n */\n public moveFocusToControl(control: IFocusableControl): void {\n this.focusedControl = control;\n this._lastPickedControl = <any>control;\n this._blockNextFocusCheck = true;\n }\n private _manageFocus(): void {\n if (this._blockNextFocusCheck) {\n this._blockNextFocusCheck = false;\n this._lastPickedControl = <any>this._focusedControl;\n return;\n }\n // Focus management\n if (this._focusedControl) {\n if (this._focusedControl !== <any>this._lastPickedControl) {\n if (this._lastPickedControl.isFocusInvisible) {\n return;\n }\n this.focusedControl = null;\n }\n }\n }\n private _attachToOnPointerOut(scene: Scene): void {\n this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => {\n if (this._lastControlOver[pointerEvent.pointerId]) {\n this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null);\n }\n delete this._lastControlOver[pointerEvent.pointerId];\n if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) {\n this._lastControlDown[pointerEvent.pointerId]._forcePointerUp();\n delete this._lastControlDown[pointerEvent.pointerId];\n }\n });\n }\n private _attachToOnBlur(scene: Scene): void {\n this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add((pointerEvent) => {\n Object.entries(this._lastControlDown).forEach(([key, value]) => {\n value._onCanvasBlur();\n });\n this.focusedControl = null;\n this._lastControlDown = {};\n });\n }\n\n /**\n * Serializes the entire GUI system\n * @returns an object with the JSON serialized data\n */\n public serializeContent(): any {\n const size = this.getSize();\n let serializationObject = {\n root: {},\n width: size.width,\n height: size.height,\n };\n\n this._rootContainer.serialize(serializationObject.root);\n\n return serializationObject;\n }\n\n /**\n * Recreate the content of the ADT from a JSON object\n * @param serializedObject define the JSON serialized object to restore from\n * @param scaleToSize defines whether to scale to texture to the saved size\n */\n public parseContent(serializedObject: any, scaleToSize?: boolean) {\n this._rootContainer = Control.Parse(serializedObject.root, this) as Container;\n if (scaleToSize) {\n const width = serializedObject.width;\n const height = serializedObject.height;\n if (typeof width === \"number\" && typeof height === \"number\" && width >= 0 && height >= 0) {\n this.scaleTo(width, height);\n } else {\n // scales the GUI to a default size if none was available in the serialized content\n this.scaleTo(1920, 1080);\n }\n }\n }\n\n /**\n * Recreate the content of the ADT from a snippet saved by the GUI editor\n * @param snippetId defines the snippet to load\n * @param scaleToSize defines whether to scale to texture to the saved size\n * @returns a promise that will resolve on success\n */\n public parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void> {\n if (snippetId === \"_BLANK\") {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n var request = new WebRequest();\n request.addEventListener(\"readystatechange\", () => {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\n let serializationObject = JSON.parse(snippet.gui);\n\n this.parseContent(serializationObject, scaleToSize);\n this.snippetId = snippetId;\n\n resolve();\n } else {\n reject(\"Unable to load the snippet \" + snippetId);\n }\n }\n });\n\n request.open(\"GET\", AdvancedDynamicTexture.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\n request.send();\n });\n }\n\n /**\n * Recreate the content of the ADT from a url json\n * @param url defines the url to load\n * @param scaleToSize defines whether to scale to texture to the saved size\n * @returns a promise that will resolve on success\n */\n public parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void> {\n if (url === \"\") {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n var request = new WebRequest();\n request.addEventListener(\"readystatechange\", () => {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var gui = request.responseText;\n let serializationObject = JSON.parse(gui);\n this.parseContent(serializationObject, scaleToSize);\n\n resolve();\n } else {\n reject(\"Unable to load\");\n }\n }\n });\n request.open(\"GET\", url);\n request.send();\n });\n }\n\n // Statics\n /**\n * Compares two rectangle based controls for pixel overlap\n * @param control1 The first control to compare\n * @param control2 The second control to compare\n * @returns true if overlaps, otherwise false\n */\n private static _Overlaps(control1: Control, control2: Control) {\n return !(\n control1.centerX > control2.centerX + control2.widthInPixels ||\n control1.centerX + control1.widthInPixels < control2.centerX ||\n control1.centerY + control1.heightInPixels < control2.centerY ||\n control1.centerY > control2.centerY + control2.heightInPixels\n );\n }\n\n /**\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)\n * @param mesh defines the mesh which will receive the texture\n * @param width defines the texture width (1024 by default)\n * @param height defines the texture height (1024 by default)\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\n * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateForMesh(mesh: AbstractMesh, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false, invertY?: boolean): AdvancedDynamicTexture {\n // use a unique ID in name so serialization will work even if you create two ADTs for a single mesh\n const uniqueId = RandomGUID();\n var result = new AdvancedDynamicTexture(\n `AdvancedDynamicTexture for ${mesh.name} [${uniqueId}]`,\n width,\n height,\n mesh.getScene(),\n true,\n Texture.TRILINEAR_SAMPLINGMODE,\n invertY\n );\n var material = new StandardMaterial(`AdvancedDynamicTextureMaterial for ${mesh.name} [${uniqueId}]`, mesh.getScene());\n material.backFaceCulling = false;\n material.diffuseColor = Color3.Black();\n material.specularColor = Color3.Black();\n if (onlyAlphaTesting) {\n material.diffuseTexture = result;\n material.emissiveTexture = result;\n result.hasAlpha = true;\n } else {\n material.emissiveTexture = result;\n material.opacityTexture = result;\n }\n mesh.material = material;\n result.attachToMesh(mesh, supportPointerMove);\n return result;\n }\n\n /**\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture\n * @param mesh defines the mesh which will receive the texture\n * @param width defines the texture width (1024 by default)\n * @param height defines the texture height (1024 by default)\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateForMeshTexture(mesh: AbstractMesh, width = 1024, height = 1024, supportPointerMove = true, invertY?: boolean): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(mesh.name + \" AdvancedDynamicTexture\", width, height, mesh.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY);\n result.attachToMesh(mesh, supportPointerMove);\n return result;\n }\n /**\n * Creates a new AdvancedDynamicTexture in fullscreen mode.\n * In this mode the texture will rely on a layer for its rendering.\n * This allows it to be treated like any other layer.\n * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.\n * LayerMask is set through advancedTexture.layer.layerMask\n * @param name defines name for the texture\n * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)\n * @param scene defines the hosting scene\n * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)\n * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateFullscreenUI(\n name: string,\n foreground: boolean = true,\n scene: Nullable<Scene> = null,\n sampling = Texture.BILINEAR_SAMPLINGMODE,\n adaptiveScaling: boolean = false\n ): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);\n // Display\n const resultScene = result.getScene();\n var layer = new Layer(name + \"_layer\", null, resultScene, !foreground);\n layer.texture = result;\n result._layerToDispose = layer;\n result._isFullscreen = true;\n\n if (adaptiveScaling && resultScene) {\n const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();\n result._rootContainer.scaleX = newScale;\n result._rootContainer.scaleY = newScale;\n }\n\n // Attach\n result.attach();\n return result;\n }\n\n /**\n * Scales the texture\n * @param ratio the scale factor to apply to both width and height\n */\n public scale(ratio: number): void {\n super.scale(ratio);\n this.markAsDirty();\n }\n\n /**\n * Resizes the texture\n * @param width the new width\n * @param height the new height\n */\n public scaleTo(width: number, height: number): void {\n super.scaleTo(width, height);\n this.markAsDirty();\n }\n}\n\nexport { IFocusableControl };\n"]}
@@ -25,6 +25,8 @@ export declare class InputText extends Control implements IFocusableControl {
25
25
  private _autoStretchWidth;
26
26
  private _maxWidth;
27
27
  private _isFocused;
28
+ /** the type of device that most recently focused the input: "mouse", "touch" or "pen" */
29
+ private _focusedBy;
28
30
  private _blinkTimeout;
29
31
  private _blinkIsEven;
30
32
  private _cursorOffset;
@@ -386,7 +386,7 @@ var InputText = /** @class */ (function (_super) {
386
386
  this._cursorOffset = 0;
387
387
  this._markAsDirty();
388
388
  this.onFocusObservable.notifyObservers(this);
389
- if (navigator.userAgent.indexOf("Mobile") !== -1 && !this.disableMobilePrompt) {
389
+ if (this._focusedBy === "touch" && !this.disableMobilePrompt) {
390
390
  var value = prompt(this.promptMessage);
391
391
  if (value !== null) {
392
392
  this.text = value;
@@ -999,6 +999,7 @@ var InputText = /** @class */ (function (_super) {
999
999
  this._cursorIndex = -1;
1000
1000
  this._isPointerDown = true;
1001
1001
  this._host._capturingControl[pointerId] = this;
1002
+ this._focusedBy = pi.event.pointerType;
1002
1003
  if (this._host.focusedControl === this) {
1003
1004
  // Move cursor
1004
1005
  clearTimeout(this._blinkTimeout);
@@ -1 +1 @@
1
- {"version":3,"file":"inputText.js","sourceRoot":"","sources":["../../../../sourceES6/gui/src/2D/controls/inputText.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAY,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAe,iBAAiB,EAAmB,MAAM,sCAAsC,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAI5D;;GAEG;AACH;IAA+B,6BAAO;IA6UlC;;;;OAIG;IACH,mBAAmB,IAAa,EAAE,IAAiB;QAAjB,qBAAA,EAAA,SAAiB;QAAnD,YACI,kBAAM,IAAI,CAAC,SAId;QALkB,UAAI,GAAJ,IAAI,CAAS;QAhVxB,sBAAgB,GAAG,EAAE,CAAC;QACtB,iBAAW,GAAG,SAAS,CAAC;QACxB,wBAAkB,GAAG,SAAS,CAAC;QAC/B,mBAAa,GAAG,OAA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jCD,CAA+B,OAAO,GA0jCrC;SA1jCY,SAAS;AA2jCtB,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { Observable, Observer } from \"@babylonjs/core/Misc/observable\";\nimport { Vector2 } from \"@babylonjs/core/Maths/math.vector\";\nimport { ClipboardEventTypes, ClipboardInfo } from \"@babylonjs/core/Events/clipboardEvents\";\nimport { PointerInfo, PointerEventTypes, PointerInfoBase } from '@babylonjs/core/Events/pointerEvents';\n\nimport { Control } from \"./control\";\nimport { IFocusableControl } from \"./focusableControl\";\nimport { ValueAndUnit } from \"../valueAndUnit\";\nimport { VirtualKeyboard } from \"./virtualKeyboard\";\nimport { RegisterClass } from '@babylonjs/core/Misc/typeStore';\nimport { Measure } from '../measure';\nimport { TextWrapper } from './textWrapper';\nimport { serialize } from '@babylonjs/core/Misc/decorators';\nimport { IKeyboardEvent } from '@babylonjs/core/Events/deviceInputEvents';\nimport { ICanvasRenderingContext } from \"@babylonjs/core/Engines/ICanvas\";\n\n/**\n * Class used to create input text control\n */\nexport class InputText extends Control implements IFocusableControl {\n private _textWrapper: TextWrapper;\n private _placeholderText = \"\";\n private _background = \"#222222\";\n private _focusedBackground = \"#000000\";\n private _focusedColor = \"white\";\n private _placeholderColor = \"gray\";\n private _thickness = 1;\n private _margin = new ValueAndUnit(10, ValueAndUnit.UNITMODE_PIXEL);\n private _autoStretchWidth = true;\n private _maxWidth = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\n private _isFocused = false;\n private _blinkTimeout: number;\n private _blinkIsEven = false;\n private _cursorOffset = 0;\n private _scrollLeft: Nullable<number>;\n private _textWidth: number;\n private _clickedCoordinate: Nullable<number>;\n private _deadKey = false;\n private _addKey = true;\n private _currentKey = \"\";\n private _isTextHighlightOn = false;\n private _textHighlightColor = \"#d5e0ff\";\n private _highligherOpacity = 0.4;\n private _highlightedText = \"\";\n private _startHighlightIndex = 0;\n private _endHighlightIndex = 0;\n private _cursorIndex = -1;\n private _onFocusSelectAll = false;\n private _isPointerDown = false;\n private _onClipboardObserver: Nullable<Observer<ClipboardInfo>>;\n private _onPointerDblTapObserver: Nullable<Observer<PointerInfo>>;\n\n /** @hidden */\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\n\n /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */\n @serialize()\n public promptMessage = \"Please enter text:\";\n /** Force disable prompt on mobile device */\n @serialize()\n public disableMobilePrompt = false;\n\n /** Observable raised when the text changes */\n public onTextChangedObservable = new Observable<InputText>();\n /** Observable raised just before an entered character is to be added */\n public onBeforeKeyAddObservable = new Observable<InputText>();\n /** Observable raised when the control gets the focus */\n public onFocusObservable = new Observable<InputText>();\n /** Observable raised when the control loses the focus */\n public onBlurObservable = new Observable<InputText>();\n /**Observable raised when the text is highlighted */\n public onTextHighlightObservable = new Observable<InputText>();\n /**Observable raised when copy event is triggered */\n public onTextCopyObservable = new Observable<InputText>();\n /** Observable raised when cut event is triggered */\n public onTextCutObservable = new Observable<InputText>();\n /** Observable raised when paste event is triggered */\n public onTextPasteObservable = new Observable<InputText>();\n /** Observable raised when a key event was processed */\n public onKeyboardEventProcessedObservable = new Observable<IKeyboardEvent>();\n\n /** Gets or sets the maximum width allowed by the control */\n @serialize()\n public get maxWidth(): string | number {\n return this._maxWidth.toString(this._host);\n }\n\n /** Gets the maximum width allowed by the control in pixels */\n public get maxWidthInPixels(): number {\n return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\n }\n\n public set maxWidth(value: string | number) {\n if (this._maxWidth.toString(this._host) === value) {\n return;\n }\n\n if (this._maxWidth.fromString(value)) {\n this._markAsDirty();\n }\n }\n\n /** Gets or sets the text highlighter transparency; default: 0.4 */\n @serialize()\n public get highligherOpacity(): number {\n return this._highligherOpacity;\n }\n\n public set highligherOpacity(value: number) {\n if (this._highligherOpacity === value) {\n return;\n }\n this._highligherOpacity = value;\n this._markAsDirty();\n }\n /** Gets or sets a boolean indicating whether to select complete text by default on input focus */\n @serialize()\n public get onFocusSelectAll(): boolean {\n return this._onFocusSelectAll;\n }\n\n public set onFocusSelectAll(value: boolean) {\n if (this._onFocusSelectAll === value) {\n return;\n }\n\n this._onFocusSelectAll = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the text hightlight color */\n @serialize()\n public get textHighlightColor(): string {\n return this._textHighlightColor;\n }\n\n public set textHighlightColor(value: string) {\n if (this._textHighlightColor === value) {\n return;\n }\n this._textHighlightColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets control margin */\n @serialize()\n public get margin(): string {\n return this._margin.toString(this._host);\n }\n\n /** Gets control margin in pixels */\n public get marginInPixels(): number {\n return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\n }\n\n public set margin(value: string) {\n if (this._margin.toString(this._host) === value) {\n return;\n }\n\n if (this._margin.fromString(value)) {\n this._markAsDirty();\n }\n }\n\n /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */\n @serialize()\n public get autoStretchWidth(): boolean {\n return this._autoStretchWidth;\n }\n\n public set autoStretchWidth(value: boolean) {\n if (this._autoStretchWidth === value) {\n return;\n }\n\n this._autoStretchWidth = value;\n this._markAsDirty();\n }\n\n /** Gets or sets border thickness */\n @serialize()\n public get thickness(): number {\n return this._thickness;\n }\n\n public set thickness(value: number) {\n if (this._thickness === value) {\n return;\n }\n\n this._thickness = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color when focused */\n @serialize()\n public get focusedBackground(): string {\n return this._focusedBackground;\n }\n\n public set focusedBackground(value: string) {\n if (this._focusedBackground === value) {\n return;\n }\n\n this._focusedBackground = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color when focused */\n @serialize()\n public get focusedColor(): string {\n return this._focusedColor;\n }\n\n public set focusedColor(value: string) {\n if (this._focusedColor === value) {\n return;\n }\n\n this._focusedColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color */\n @serialize()\n public get background(): string {\n return this._background;\n }\n\n public set background(value: string) {\n if (this._background === value) {\n return;\n }\n\n this._background = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the placeholder color */\n @serialize()\n public get placeholderColor(): string {\n return this._placeholderColor;\n }\n\n public set placeholderColor(value: string) {\n if (this._placeholderColor === value) {\n return;\n }\n\n this._placeholderColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the text displayed when the control is empty */\n @serialize()\n public get placeholderText(): string {\n return this._placeholderText;\n }\n\n public set placeholderText(value: string) {\n if (this._placeholderText === value) {\n return;\n }\n this._placeholderText = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the dead key flag */\n @serialize()\n public get deadKey(): boolean {\n return this._deadKey;\n }\n\n public set deadKey(flag: boolean) {\n this._deadKey = flag;\n }\n\n /** Gets or sets the highlight text */\n public get highlightedText(): string {\n return this._highlightedText;\n }\n public set highlightedText(text: string) {\n if (this._highlightedText === text) {\n return;\n }\n this._highlightedText = text;\n this._markAsDirty();\n }\n\n /** Gets or sets if the current key should be added */\n public get addKey(): boolean {\n return this._addKey;\n }\n\n public set addKey(flag: boolean) {\n this._addKey = flag;\n }\n\n /** Gets or sets the value of the current key being entered */\n public get currentKey(): string {\n return this._currentKey;\n }\n\n public set currentKey(key: string) {\n this._currentKey = key;\n }\n\n /** Gets or sets the text displayed in the control */\n @serialize()\n public get text(): string {\n return this._textWrapper.text;\n }\n\n public set text(value: string) {\n let valueAsString = value.toString(); // Forcing convertion\n\n if (!this._textWrapper) {\n this._textWrapper = new TextWrapper();\n }\n\n if (this._textWrapper.text === valueAsString) {\n return;\n }\n this._textWrapper.text = valueAsString;\n this._textHasChanged();\n }\n\n private _textHasChanged(): void {\n this._markAsDirty();\n this.onTextChangedObservable.notifyObservers(this);\n }\n\n /** Gets or sets control width */\n @serialize()\n public get width(): string | number {\n return this._width.toString(this._host);\n }\n\n public set width(value: string | number) {\n if (this._width.toString(this._host) === value) {\n return;\n }\n\n if (this._width.fromString(value)) {\n this._markAsDirty();\n }\n\n this.autoStretchWidth = false;\n }\n\n /**\n * Creates a new InputText\n * @param name defines the control name\n * @param text defines the text of the control\n */\n constructor(public name?: string, text: string = \"\") {\n super(name);\n\n this.text = text;\n this.isPointerBlocker = true;\n }\n\n /** @hidden */\n public onBlur(): void {\n this._isFocused = false;\n this._scrollLeft = null;\n this._cursorOffset = 0;\n clearTimeout(this._blinkTimeout);\n this._markAsDirty();\n\n this.onBlurObservable.notifyObservers(this);\n\n this._host.unRegisterClipboardEvents();\n if (this._onClipboardObserver) {\n this._host.onClipboardObservable.remove(this._onClipboardObserver);\n }\n let scene = this._host.getScene();\n if (this._onPointerDblTapObserver && scene) {\n scene.onPointerObservable.remove(this._onPointerDblTapObserver);\n }\n }\n\n /** @hidden */\n public onFocus(): void {\n if (!this._isEnabled) {\n return;\n }\n this._scrollLeft = null;\n this._isFocused = true;\n this._blinkIsEven = false;\n this._cursorOffset = 0;\n this._markAsDirty();\n\n this.onFocusObservable.notifyObservers(this);\n\n if (navigator.userAgent.indexOf(\"Mobile\") !== -1 && !this.disableMobilePrompt) {\n let value = prompt(this.promptMessage);\n\n if (value !== null) {\n this.text = value;\n }\n this._host.focusedControl = null;\n return;\n }\n\n this._host.registerClipboardEvents();\n\n this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => {\n // process clipboard event, can be configured.\n switch (clipboardInfo.type) {\n case ClipboardEventTypes.COPY:\n this._onCopyText(clipboardInfo.event);\n this.onTextCopyObservable.notifyObservers(this);\n break;\n case ClipboardEventTypes.CUT:\n this._onCutText(clipboardInfo.event);\n this.onTextCutObservable.notifyObservers(this);\n break;\n case ClipboardEventTypes.PASTE:\n this._onPasteText(clipboardInfo.event);\n this.onTextPasteObservable.notifyObservers(this);\n break;\n default: return;\n }\n });\n\n let scene = this._host.getScene();\n if (scene) {\n //register the pointer double tap event\n this._onPointerDblTapObserver = scene.onPointerObservable.add((pointerInfo) => {\n if (!this._isFocused) {\n return;\n }\n if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) {\n this._processDblClick(pointerInfo);\n }\n });\n }\n\n if (this._onFocusSelectAll) {\n this._selectAllText();\n }\n\n }\n\n /**\n * Function to focus an inputText programmatically\n */\n public focus() {\n this._host.moveFocusToControl(this);\n }\n\n /**\n * Function to unfocus an inputText programmatically\n */\n public blur() {\n this._host.focusedControl = null;\n }\n\n protected _getTypeName(): string {\n return \"InputText\";\n }\n\n /**\n * Function called to get the list of controls that should not steal the focus from this control\n * @returns an array of controls\n */\n public keepsFocusWith(): Nullable<Control[]> {\n if (!this._connectedVirtualKeyboard) {\n return null;\n }\n return [this._connectedVirtualKeyboard];\n }\n\n /** @hidden */\n public processKey(keyCode: number, key?: string, evt?: IKeyboardEvent) {\n if (this.isReadOnly) {\n return;\n }\n\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\n if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) {\n return;\n }\n\n //select all\n if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) {\n this._selectAllText();\n evt.preventDefault();\n return;\n }\n // Specific cases\n switch (keyCode) {\n case 32: //SPACE\n key = \" \"; //ie11 key for space is \"Spacebar\"\n break;\n case 191: //SLASH\n if (evt) {\n evt.preventDefault();\n }\n break;\n case 8: // BACKSPACE\n if (this._textWrapper.text && this._textWrapper.length > 0) {\n //delete the highlighted text\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this._blinkIsEven = false;\n if (evt) {\n evt.preventDefault();\n }\n return;\n }\n //delete single character\n if (this._cursorOffset === 0) {\n this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);\n } else {\n let deletePosition = this._textWrapper.length - this._cursorOffset;\n if (deletePosition > 0) {\n this._textWrapper.removePart(deletePosition - 1, deletePosition);\n this._textHasChanged();\n }\n }\n }\n if (evt) {\n evt.preventDefault();\n }\n return;\n case 46: // DELETE\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n if (evt) {\n evt.preventDefault();\n }\n return;\n }\n if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {\n let deletePosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(deletePosition, deletePosition + 1);\n this._textHasChanged();\n this._cursorOffset--;\n }\n if (evt) {\n evt.preventDefault();\n }\n return;\n case 13: // RETURN\n this._host.focusedControl = null;\n this._isTextHighlightOn = false;\n return;\n case 35: // END\n this._cursorOffset = 0;\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n case 36: // HOME\n this._cursorOffset = this._textWrapper.length;\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n case 37: // LEFT\n this._cursorOffset++;\n if (this._cursorOffset > this._textWrapper.length) {\n this._cursorOffset = this._textWrapper.length;\n }\n\n if (evt && evt.shiftKey) {\n // update the cursor\n this._blinkIsEven = false;\n // shift + ctrl/cmd + <-\n if (evt.ctrlKey || evt.metaKey) {\n if (!this._isTextHighlightOn) {\n if (this._textWrapper.length === this._cursorOffset) {\n return;\n }\n else {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;\n }\n }\n this._startHighlightIndex = 0;\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\n this._cursorOffset = this._textWrapper.length;\n this._isTextHighlightOn = true;\n this._markAsDirty();\n return;\n }\n //store the starting point\n if (!this._isTextHighlightOn) {\n this._isTextHighlightOn = true;\n this._cursorIndex = (this._cursorOffset >= this._textWrapper.length) ? this._textWrapper.length : this._cursorOffset - 1;\n }\n //if text is already highlighted\n else if (this._cursorIndex === -1) {\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\n this._cursorOffset = (this._startHighlightIndex === 0) ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1;\n }\n //set the highlight indexes\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n }\n this._markAsDirty();\n return;\n }\n if (this._isTextHighlightOn) {\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this._isTextHighlightOn = false;\n }\n if (evt && (evt.ctrlKey || evt.metaKey)) {\n this._cursorOffset = this._textWrapper.length;\n evt.preventDefault();\n }\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._cursorIndex = -1;\n this._markAsDirty();\n return;\n case 39: // RIGHT\n this._cursorOffset--;\n if (this._cursorOffset < 0) {\n this._cursorOffset = 0;\n }\n if (evt && evt.shiftKey) {\n //update the cursor\n this._blinkIsEven = false;\n //shift + ctrl/cmd + ->\n if (evt.ctrlKey || evt.metaKey) {\n if (!this._isTextHighlightOn) {\n if (this._cursorOffset === 0) {\n return;\n }\n else {\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;\n }\n }\n this._endHighlightIndex = this._textWrapper.length;\n this._isTextHighlightOn = true;\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\n this._cursorOffset = 0;\n this._markAsDirty();\n return;\n }\n\n if (!this._isTextHighlightOn) {\n this._isTextHighlightOn = true;\n this._cursorIndex = (this._cursorOffset <= 0) ? 0 : this._cursorOffset + 1;\n }\n //if text is already highlighted\n else if (this._cursorIndex === -1) {\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\n this._cursorOffset = (this._textWrapper.length === this._endHighlightIndex) ? 0 : this._textWrapper.length - this._endHighlightIndex - 1;\n }\n //set the highlight indexes\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n }\n this._markAsDirty();\n return;\n }\n if (this._isTextHighlightOn) {\n this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;\n this._isTextHighlightOn = false;\n }\n //ctr + ->\n if (evt && (evt.ctrlKey || evt.metaKey)) {\n this._cursorOffset = 0;\n evt.preventDefault();\n }\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._cursorIndex = -1;\n this._markAsDirty();\n return;\n case 222: // Dead\n if (evt) {\n //add support for single and double quotes\n if (evt.code == \"Quote\") {\n if (evt.shiftKey) {\n keyCode = 34;\n key = '\"';\n } else {\n keyCode = 39;\n key = \"'\";\n }\n } else {\n evt.preventDefault();\n this._cursorIndex = -1;\n this.deadKey = true;\n }\n } else {\n this._cursorIndex = -1;\n this.deadKey = true;\n }\n break;\n }\n // Printable characters\n if (key &&\n ((keyCode === -1) || // Direct access\n (keyCode === 32) || // Space\n (keyCode === 34) || // \" add support for single and double quotes\n (keyCode === 39) || // '\n (keyCode > 47 && keyCode < 64) || // Numbers\n (keyCode > 64 && keyCode < 91) || // Letters\n (keyCode > 159 && keyCode < 193) || // Special characters\n (keyCode > 218 && keyCode < 223) || // Special characters\n (keyCode > 95 && keyCode < 112))) { // Numpad\n this._currentKey = key;\n this.onBeforeKeyAddObservable.notifyObservers(this);\n key = this._currentKey;\n if (this._addKey) {\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);\n this._textHasChanged();\n this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);\n this._isTextHighlightOn = false;\n this._blinkIsEven = false;\n this._markAsDirty();\n }\n else if (this._cursorOffset === 0) {\n this.text += key;\n } else {\n let insertPosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(insertPosition, insertPosition, key);\n this._textHasChanged();\n }\n }\n }\n }\n\n /** @hidden */\n private _updateValueFromCursorIndex(offset: number) {\n //update the cursor\n this._blinkIsEven = false;\n\n if (this._cursorIndex === -1) {\n this._cursorIndex = offset;\n } else {\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n }\n }\n this._isTextHighlightOn = true;\n this._markAsDirty();\n }\n /** @hidden */\n private _processDblClick(evt: PointerInfo) {\n //pre-find the start and end index of the word under cursor, speeds up the rendering\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._endHighlightIndex = this._startHighlightIndex;\n let moveLeft, moveRight;\n do {\n moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0;\n moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;\n } while (moveLeft || moveRight);\n\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this.onTextHighlightObservable.notifyObservers(this);\n\n this._isTextHighlightOn = true;\n this._clickedCoordinate = null;\n this._blinkIsEven = true;\n this._cursorIndex = -1;\n this._markAsDirty();\n }\n /** @hidden */\n private _selectAllText() {\n this._blinkIsEven = true;\n this._isTextHighlightOn = true;\n\n this._startHighlightIndex = 0;\n this._endHighlightIndex = this._textWrapper.length;\n this._cursorOffset = this._textWrapper.length;\n this._cursorIndex = -1;\n this._markAsDirty();\n }\n\n /**\n * Handles the keyboard event\n * @param evt Defines the KeyboardEvent\n */\n public processKeyboard(evt: IKeyboardEvent): void {\n // process pressed key\n this.processKey(evt.keyCode, evt.key, evt);\n\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\n }\n\n /** @hidden */\n private _onCopyText(ev: ClipboardEvent): void {\n this._isTextHighlightOn = false;\n //when write permission to clipbaord data is denied\n try {\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\n }\n catch { } //pass\n this._host.clipboardData = this._highlightedText;\n }\n /** @hidden */\n private _onCutText(ev: ClipboardEvent): void {\n if (!this._highlightedText) {\n return;\n }\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n //when write permission to clipbaord data is denied\n try {\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\n }\n catch { } //pass\n\n this._host.clipboardData = this._highlightedText;\n this._highlightedText = \"\";\n }\n /** @hidden */\n private _onPasteText(ev: ClipboardEvent): void {\n let data: string = \"\";\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\n data = ev.clipboardData.getData(\"text/plain\");\n }\n else {\n //get the cached data; returns blank string by default\n data = this._host.clipboardData;\n }\n let insertPosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(insertPosition, insertPosition, data);\n this._textHasChanged();\n }\n\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\n context.save();\n\n this._applyStates(context);\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowColor = this.shadowColor;\n context.shadowBlur = this.shadowBlur;\n context.shadowOffsetX = this.shadowOffsetX;\n context.shadowOffsetY = this.shadowOffsetY;\n }\n\n // Background\n if (this._isFocused) {\n if (this._focusedBackground) {\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\n\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\n }\n } else if (this._background) {\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\n\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\n }\n\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n\n if (!this._fontOffset || this._wasDirty) {\n this._fontOffset = Control._GetFontOffset(context.font);\n }\n\n // Text\n let clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);\n if (this.color) {\n context.fillStyle = this.color;\n }\n\n let text = this._beforeRenderText(this._textWrapper);\n\n if (!this._isFocused && !this._textWrapper.text && this._placeholderText) {\n text = new TextWrapper();\n text.text = this._placeholderText;\n\n if (this._placeholderColor) {\n context.fillStyle = this._placeholderColor;\n }\n }\n\n this._textWidth = context.measureText(text.text).width;\n let marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;\n if (this._autoStretchWidth) {\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + \"px\";\n this._autoStretchWidth = true; // setting the width will have reset _autoStretchWidth to false!\n }\n\n let rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2;\n let availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth;\n\n context.save();\n context.beginPath();\n context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height);\n context.clip();\n\n if (this._isFocused && this._textWidth > availableWidth) {\n let textLeft = clipTextLeft - this._textWidth + availableWidth;\n if (!this._scrollLeft) {\n this._scrollLeft = textLeft;\n }\n } else {\n this._scrollLeft = clipTextLeft;\n }\n\n context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);\n\n // Cursor\n if (this._isFocused) {\n\n // Need to move cursor\n if (this._clickedCoordinate) {\n var rightPosition = this._scrollLeft + this._textWidth;\n var absoluteCursorPosition = rightPosition - this._clickedCoordinate;\n var currentSize = 0;\n this._cursorOffset = 0;\n var previousDist = 0;\n do {\n if (this._cursorOffset) {\n previousDist = Math.abs(absoluteCursorPosition - currentSize);\n }\n this._cursorOffset++;\n currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;\n\n } while (currentSize < absoluteCursorPosition && (text.length >= this._cursorOffset));\n\n // Find closest move\n if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {\n this._cursorOffset--;\n }\n\n this._blinkIsEven = false;\n this._clickedCoordinate = null;\n }\n\n // Render cursor\n if (!this._blinkIsEven) {\n let cursorOffsetText = text.substr(text.length - this._cursorOffset);\n let cursorOffsetWidth = context.measureText(cursorOffsetText).width;\n let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth;\n\n if (cursorLeft < clipTextLeft) {\n this._scrollLeft += (clipTextLeft - cursorLeft);\n cursorLeft = clipTextLeft;\n this._markAsDirty();\n } else if (cursorLeft > clipTextLeft + availableWidth) {\n this._scrollLeft += (clipTextLeft + availableWidth - cursorLeft);\n cursorLeft = clipTextLeft + availableWidth;\n this._markAsDirty();\n }\n if (!this._isTextHighlightOn) {\n context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);\n }\n }\n\n clearTimeout(this._blinkTimeout);\n this._blinkTimeout = <any>setTimeout(() => {\n this._blinkIsEven = !this._blinkIsEven;\n this._markAsDirty();\n }, 500);\n\n //show the highlighted text\n if (this._isTextHighlightOn) {\n clearTimeout(this._blinkTimeout);\n let highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;\n let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;\n this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex);\n let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width;\n if (highlightCursorLeft < clipTextLeft) {\n width = width - (clipTextLeft - highlightCursorLeft);\n if (!width) {\n // when using left arrow on text.length > availableWidth;\n // assigns the width of the first letter after clipTextLeft\n width = context.measureText(text.charAt(text.length - this._cursorOffset)).width;\n }\n highlightCursorLeft = clipTextLeft;\n }\n //for transparancy\n context.globalAlpha = this._highligherOpacity;\n context.fillStyle = this._textHighlightColor;\n context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height);\n context.globalAlpha = 1.0;\n }\n }\n context.restore();\n\n // Border\n if (this._thickness) {\n if (this._isFocused) {\n if (this.focusedColor) {\n context.strokeStyle = this.focusedColor;\n }\n } else {\n if (this.color) {\n context.strokeStyle = this.color;\n }\n }\n\n context.lineWidth = this._thickness;\n\n context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2,\n this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness);\n }\n\n context.restore();\n }\n\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\n return false;\n }\n\n if (this.isReadOnly) {\n return true;\n }\n\n this._clickedCoordinate = coordinates.x;\n this._isTextHighlightOn = false;\n this._highlightedText = \"\";\n this._cursorIndex = -1;\n this._isPointerDown = true;\n this._host._capturingControl[pointerId] = this;\n if (this._host.focusedControl === this) {\n // Move cursor\n clearTimeout(this._blinkTimeout);\n this._markAsDirty();\n return true;\n }\n if (!this._isEnabled) {\n return false;\n }\n this._host.focusedControl = this;\n\n return true;\n }\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\n this._clickedCoordinate = coordinates.x;\n this._markAsDirty();\n this._updateValueFromCursorIndex(this._cursorOffset);\n }\n super._onPointerMove(target, coordinates, pointerId, pi);\n }\n\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\n\n this._isPointerDown = false;\n delete this._host._capturingControl[pointerId];\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\n }\n\n protected _beforeRenderText(textWrapper: TextWrapper): TextWrapper {\n return textWrapper;\n }\n\n public dispose() {\n super.dispose();\n\n this.onBlurObservable.clear();\n this.onFocusObservable.clear();\n this.onTextChangedObservable.clear();\n this.onTextCopyObservable.clear();\n this.onTextCutObservable.clear();\n this.onTextPasteObservable.clear();\n this.onTextHighlightObservable.clear();\n this.onKeyboardEventProcessedObservable.clear();\n }\n}\nRegisterClass(\"BABYLON.GUI.InputText\", InputText);\n"]}
1
+ {"version":3,"file":"inputText.js","sourceRoot":"","sources":["../../../../sourceES6/gui/src/2D/controls/inputText.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAY,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAe,iBAAiB,EAAmB,MAAM,sCAAsC,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAI5D;;GAEG;AACH;IAA+B,6BAAO;IA+UlC;;;;OAIG;IACH,mBAAmB,IAAa,EAAE,IAAiB;QAAjB,qBAAA,EAAA,SAAiB;QAAnD,YACI,kBAAM,IAAI,CAAC,SAId;QALkB,UAAI,GAAJ,IAAI,CAAS;QAlVxB,sBAAgB,GAAG,EAAE,CAAC;QACtB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QADC,SAAS,EAAE;4CAGX;IAsCD;QADC,SAAS,EAAE;yCAGX;IAuBD;QADC,SAAS,EAAE;0CAGX;IA4vBL,gBAAC;CAAA,AA7jCD,CAA+B,OAAO,GA6jCrC;SA7jCY,SAAS;AA8jCtB,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { Observable, Observer } from \"@babylonjs/core/Misc/observable\";\nimport { Vector2 } from \"@babylonjs/core/Maths/math.vector\";\nimport { ClipboardEventTypes, ClipboardInfo } from \"@babylonjs/core/Events/clipboardEvents\";\nimport { PointerInfo, PointerEventTypes, PointerInfoBase } from '@babylonjs/core/Events/pointerEvents';\n\nimport { Control } from \"./control\";\nimport { IFocusableControl } from \"./focusableControl\";\nimport { ValueAndUnit } from \"../valueAndUnit\";\nimport { VirtualKeyboard } from \"./virtualKeyboard\";\nimport { RegisterClass } from '@babylonjs/core/Misc/typeStore';\nimport { Measure } from '../measure';\nimport { TextWrapper } from './textWrapper';\nimport { serialize } from '@babylonjs/core/Misc/decorators';\nimport { IKeyboardEvent, IPointerEvent } from '@babylonjs/core/Events/deviceInputEvents';\nimport { ICanvasRenderingContext } from \"@babylonjs/core/Engines/ICanvas\";\n\n/**\n * Class used to create input text control\n */\nexport class InputText extends Control implements IFocusableControl {\n private _textWrapper: TextWrapper;\n private _placeholderText = \"\";\n private _background = \"#222222\";\n private _focusedBackground = \"#000000\";\n private _focusedColor = \"white\";\n private _placeholderColor = \"gray\";\n private _thickness = 1;\n private _margin = new ValueAndUnit(10, ValueAndUnit.UNITMODE_PIXEL);\n private _autoStretchWidth = true;\n private _maxWidth = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\n private _isFocused = false;\n /** the type of device that most recently focused the input: \"mouse\", \"touch\" or \"pen\" */\n private _focusedBy: string;\n private _blinkTimeout: number;\n private _blinkIsEven = false;\n private _cursorOffset = 0;\n private _scrollLeft: Nullable<number>;\n private _textWidth: number;\n private _clickedCoordinate: Nullable<number>;\n private _deadKey = false;\n private _addKey = true;\n private _currentKey = \"\";\n private _isTextHighlightOn = false;\n private _textHighlightColor = \"#d5e0ff\";\n private _highligherOpacity = 0.4;\n private _highlightedText = \"\";\n private _startHighlightIndex = 0;\n private _endHighlightIndex = 0;\n private _cursorIndex = -1;\n private _onFocusSelectAll = false;\n private _isPointerDown = false;\n private _onClipboardObserver: Nullable<Observer<ClipboardInfo>>;\n private _onPointerDblTapObserver: Nullable<Observer<PointerInfo>>;\n\n /** @hidden */\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\n\n /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */\n @serialize()\n public promptMessage = \"Please enter text:\";\n /** Force disable prompt on mobile device */\n @serialize()\n public disableMobilePrompt = false;\n\n /** Observable raised when the text changes */\n public onTextChangedObservable = new Observable<InputText>();\n /** Observable raised just before an entered character is to be added */\n public onBeforeKeyAddObservable = new Observable<InputText>();\n /** Observable raised when the control gets the focus */\n public onFocusObservable = new Observable<InputText>();\n /** Observable raised when the control loses the focus */\n public onBlurObservable = new Observable<InputText>();\n /**Observable raised when the text is highlighted */\n public onTextHighlightObservable = new Observable<InputText>();\n /**Observable raised when copy event is triggered */\n public onTextCopyObservable = new Observable<InputText>();\n /** Observable raised when cut event is triggered */\n public onTextCutObservable = new Observable<InputText>();\n /** Observable raised when paste event is triggered */\n public onTextPasteObservable = new Observable<InputText>();\n /** Observable raised when a key event was processed */\n public onKeyboardEventProcessedObservable = new Observable<IKeyboardEvent>();\n\n /** Gets or sets the maximum width allowed by the control */\n @serialize()\n public get maxWidth(): string | number {\n return this._maxWidth.toString(this._host);\n }\n\n /** Gets the maximum width allowed by the control in pixels */\n public get maxWidthInPixels(): number {\n return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\n }\n\n public set maxWidth(value: string | number) {\n if (this._maxWidth.toString(this._host) === value) {\n return;\n }\n\n if (this._maxWidth.fromString(value)) {\n this._markAsDirty();\n }\n }\n\n /** Gets or sets the text highlighter transparency; default: 0.4 */\n @serialize()\n public get highligherOpacity(): number {\n return this._highligherOpacity;\n }\n\n public set highligherOpacity(value: number) {\n if (this._highligherOpacity === value) {\n return;\n }\n this._highligherOpacity = value;\n this._markAsDirty();\n }\n /** Gets or sets a boolean indicating whether to select complete text by default on input focus */\n @serialize()\n public get onFocusSelectAll(): boolean {\n return this._onFocusSelectAll;\n }\n\n public set onFocusSelectAll(value: boolean) {\n if (this._onFocusSelectAll === value) {\n return;\n }\n\n this._onFocusSelectAll = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the text hightlight color */\n @serialize()\n public get textHighlightColor(): string {\n return this._textHighlightColor;\n }\n\n public set textHighlightColor(value: string) {\n if (this._textHighlightColor === value) {\n return;\n }\n this._textHighlightColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets control margin */\n @serialize()\n public get margin(): string {\n return this._margin.toString(this._host);\n }\n\n /** Gets control margin in pixels */\n public get marginInPixels(): number {\n return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\n }\n\n public set margin(value: string) {\n if (this._margin.toString(this._host) === value) {\n return;\n }\n\n if (this._margin.fromString(value)) {\n this._markAsDirty();\n }\n }\n\n /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */\n @serialize()\n public get autoStretchWidth(): boolean {\n return this._autoStretchWidth;\n }\n\n public set autoStretchWidth(value: boolean) {\n if (this._autoStretchWidth === value) {\n return;\n }\n\n this._autoStretchWidth = value;\n this._markAsDirty();\n }\n\n /** Gets or sets border thickness */\n @serialize()\n public get thickness(): number {\n return this._thickness;\n }\n\n public set thickness(value: number) {\n if (this._thickness === value) {\n return;\n }\n\n this._thickness = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color when focused */\n @serialize()\n public get focusedBackground(): string {\n return this._focusedBackground;\n }\n\n public set focusedBackground(value: string) {\n if (this._focusedBackground === value) {\n return;\n }\n\n this._focusedBackground = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color when focused */\n @serialize()\n public get focusedColor(): string {\n return this._focusedColor;\n }\n\n public set focusedColor(value: string) {\n if (this._focusedColor === value) {\n return;\n }\n\n this._focusedColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the background color */\n @serialize()\n public get background(): string {\n return this._background;\n }\n\n public set background(value: string) {\n if (this._background === value) {\n return;\n }\n\n this._background = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the placeholder color */\n @serialize()\n public get placeholderColor(): string {\n return this._placeholderColor;\n }\n\n public set placeholderColor(value: string) {\n if (this._placeholderColor === value) {\n return;\n }\n\n this._placeholderColor = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the text displayed when the control is empty */\n @serialize()\n public get placeholderText(): string {\n return this._placeholderText;\n }\n\n public set placeholderText(value: string) {\n if (this._placeholderText === value) {\n return;\n }\n this._placeholderText = value;\n this._markAsDirty();\n }\n\n /** Gets or sets the dead key flag */\n @serialize()\n public get deadKey(): boolean {\n return this._deadKey;\n }\n\n public set deadKey(flag: boolean) {\n this._deadKey = flag;\n }\n\n /** Gets or sets the highlight text */\n public get highlightedText(): string {\n return this._highlightedText;\n }\n public set highlightedText(text: string) {\n if (this._highlightedText === text) {\n return;\n }\n this._highlightedText = text;\n this._markAsDirty();\n }\n\n /** Gets or sets if the current key should be added */\n public get addKey(): boolean {\n return this._addKey;\n }\n\n public set addKey(flag: boolean) {\n this._addKey = flag;\n }\n\n /** Gets or sets the value of the current key being entered */\n public get currentKey(): string {\n return this._currentKey;\n }\n\n public set currentKey(key: string) {\n this._currentKey = key;\n }\n\n /** Gets or sets the text displayed in the control */\n @serialize()\n public get text(): string {\n return this._textWrapper.text;\n }\n\n public set text(value: string) {\n let valueAsString = value.toString(); // Forcing convertion\n\n if (!this._textWrapper) {\n this._textWrapper = new TextWrapper();\n }\n\n if (this._textWrapper.text === valueAsString) {\n return;\n }\n this._textWrapper.text = valueAsString;\n this._textHasChanged();\n }\n\n private _textHasChanged(): void {\n this._markAsDirty();\n this.onTextChangedObservable.notifyObservers(this);\n }\n\n /** Gets or sets control width */\n @serialize()\n public get width(): string | number {\n return this._width.toString(this._host);\n }\n\n public set width(value: string | number) {\n if (this._width.toString(this._host) === value) {\n return;\n }\n\n if (this._width.fromString(value)) {\n this._markAsDirty();\n }\n\n this.autoStretchWidth = false;\n }\n\n /**\n * Creates a new InputText\n * @param name defines the control name\n * @param text defines the text of the control\n */\n constructor(public name?: string, text: string = \"\") {\n super(name);\n\n this.text = text;\n this.isPointerBlocker = true;\n }\n\n /** @hidden */\n public onBlur(): void {\n this._isFocused = false;\n this._scrollLeft = null;\n this._cursorOffset = 0;\n clearTimeout(this._blinkTimeout);\n this._markAsDirty();\n\n this.onBlurObservable.notifyObservers(this);\n\n this._host.unRegisterClipboardEvents();\n if (this._onClipboardObserver) {\n this._host.onClipboardObservable.remove(this._onClipboardObserver);\n }\n let scene = this._host.getScene();\n if (this._onPointerDblTapObserver && scene) {\n scene.onPointerObservable.remove(this._onPointerDblTapObserver);\n }\n }\n\n /** @hidden */\n public onFocus(): void {\n if (!this._isEnabled) {\n return;\n }\n this._scrollLeft = null;\n this._isFocused = true;\n this._blinkIsEven = false;\n this._cursorOffset = 0;\n this._markAsDirty();\n\n this.onFocusObservable.notifyObservers(this);\n\n if (this._focusedBy === \"touch\" && !this.disableMobilePrompt) {\n let value = prompt(this.promptMessage);\n\n if (value !== null) {\n this.text = value;\n }\n this._host.focusedControl = null;\n return;\n }\n\n this._host.registerClipboardEvents();\n\n this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => {\n // process clipboard event, can be configured.\n switch (clipboardInfo.type) {\n case ClipboardEventTypes.COPY:\n this._onCopyText(clipboardInfo.event);\n this.onTextCopyObservable.notifyObservers(this);\n break;\n case ClipboardEventTypes.CUT:\n this._onCutText(clipboardInfo.event);\n this.onTextCutObservable.notifyObservers(this);\n break;\n case ClipboardEventTypes.PASTE:\n this._onPasteText(clipboardInfo.event);\n this.onTextPasteObservable.notifyObservers(this);\n break;\n default: return;\n }\n });\n\n let scene = this._host.getScene();\n if (scene) {\n //register the pointer double tap event\n this._onPointerDblTapObserver = scene.onPointerObservable.add((pointerInfo) => {\n if (!this._isFocused) {\n return;\n }\n if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) {\n this._processDblClick(pointerInfo);\n }\n });\n }\n\n if (this._onFocusSelectAll) {\n this._selectAllText();\n }\n\n }\n\n /**\n * Function to focus an inputText programmatically\n */\n public focus() {\n this._host.moveFocusToControl(this);\n }\n\n /**\n * Function to unfocus an inputText programmatically\n */\n public blur() {\n this._host.focusedControl = null;\n }\n\n protected _getTypeName(): string {\n return \"InputText\";\n }\n\n /**\n * Function called to get the list of controls that should not steal the focus from this control\n * @returns an array of controls\n */\n public keepsFocusWith(): Nullable<Control[]> {\n if (!this._connectedVirtualKeyboard) {\n return null;\n }\n return [this._connectedVirtualKeyboard];\n }\n\n /** @hidden */\n public processKey(keyCode: number, key?: string, evt?: IKeyboardEvent) {\n if (this.isReadOnly) {\n return;\n }\n\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\n if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) {\n return;\n }\n\n //select all\n if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) {\n this._selectAllText();\n evt.preventDefault();\n return;\n }\n // Specific cases\n switch (keyCode) {\n case 32: //SPACE\n key = \" \"; //ie11 key for space is \"Spacebar\"\n break;\n case 191: //SLASH\n if (evt) {\n evt.preventDefault();\n }\n break;\n case 8: // BACKSPACE\n if (this._textWrapper.text && this._textWrapper.length > 0) {\n //delete the highlighted text\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this._blinkIsEven = false;\n if (evt) {\n evt.preventDefault();\n }\n return;\n }\n //delete single character\n if (this._cursorOffset === 0) {\n this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);\n } else {\n let deletePosition = this._textWrapper.length - this._cursorOffset;\n if (deletePosition > 0) {\n this._textWrapper.removePart(deletePosition - 1, deletePosition);\n this._textHasChanged();\n }\n }\n }\n if (evt) {\n evt.preventDefault();\n }\n return;\n case 46: // DELETE\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n if (evt) {\n evt.preventDefault();\n }\n return;\n }\n if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {\n let deletePosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(deletePosition, deletePosition + 1);\n this._textHasChanged();\n this._cursorOffset--;\n }\n if (evt) {\n evt.preventDefault();\n }\n return;\n case 13: // RETURN\n this._host.focusedControl = null;\n this._isTextHighlightOn = false;\n return;\n case 35: // END\n this._cursorOffset = 0;\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n case 36: // HOME\n this._cursorOffset = this._textWrapper.length;\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n case 37: // LEFT\n this._cursorOffset++;\n if (this._cursorOffset > this._textWrapper.length) {\n this._cursorOffset = this._textWrapper.length;\n }\n\n if (evt && evt.shiftKey) {\n // update the cursor\n this._blinkIsEven = false;\n // shift + ctrl/cmd + <-\n if (evt.ctrlKey || evt.metaKey) {\n if (!this._isTextHighlightOn) {\n if (this._textWrapper.length === this._cursorOffset) {\n return;\n }\n else {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;\n }\n }\n this._startHighlightIndex = 0;\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\n this._cursorOffset = this._textWrapper.length;\n this._isTextHighlightOn = true;\n this._markAsDirty();\n return;\n }\n //store the starting point\n if (!this._isTextHighlightOn) {\n this._isTextHighlightOn = true;\n this._cursorIndex = (this._cursorOffset >= this._textWrapper.length) ? this._textWrapper.length : this._cursorOffset - 1;\n }\n //if text is already highlighted\n else if (this._cursorIndex === -1) {\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\n this._cursorOffset = (this._startHighlightIndex === 0) ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1;\n }\n //set the highlight indexes\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n }\n this._markAsDirty();\n return;\n }\n if (this._isTextHighlightOn) {\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this._isTextHighlightOn = false;\n }\n if (evt && (evt.ctrlKey || evt.metaKey)) {\n this._cursorOffset = this._textWrapper.length;\n evt.preventDefault();\n }\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._cursorIndex = -1;\n this._markAsDirty();\n return;\n case 39: // RIGHT\n this._cursorOffset--;\n if (this._cursorOffset < 0) {\n this._cursorOffset = 0;\n }\n if (evt && evt.shiftKey) {\n //update the cursor\n this._blinkIsEven = false;\n //shift + ctrl/cmd + ->\n if (evt.ctrlKey || evt.metaKey) {\n if (!this._isTextHighlightOn) {\n if (this._cursorOffset === 0) {\n return;\n }\n else {\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;\n }\n }\n this._endHighlightIndex = this._textWrapper.length;\n this._isTextHighlightOn = true;\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\n this._cursorOffset = 0;\n this._markAsDirty();\n return;\n }\n\n if (!this._isTextHighlightOn) {\n this._isTextHighlightOn = true;\n this._cursorIndex = (this._cursorOffset <= 0) ? 0 : this._cursorOffset + 1;\n }\n //if text is already highlighted\n else if (this._cursorIndex === -1) {\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\n this._cursorOffset = (this._textWrapper.length === this._endHighlightIndex) ? 0 : this._textWrapper.length - this._endHighlightIndex - 1;\n }\n //set the highlight indexes\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n }\n this._markAsDirty();\n return;\n }\n if (this._isTextHighlightOn) {\n this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;\n this._isTextHighlightOn = false;\n }\n //ctr + ->\n if (evt && (evt.ctrlKey || evt.metaKey)) {\n this._cursorOffset = 0;\n evt.preventDefault();\n }\n this._blinkIsEven = false;\n this._isTextHighlightOn = false;\n this._cursorIndex = -1;\n this._markAsDirty();\n return;\n case 222: // Dead\n if (evt) {\n //add support for single and double quotes\n if (evt.code == \"Quote\") {\n if (evt.shiftKey) {\n keyCode = 34;\n key = '\"';\n } else {\n keyCode = 39;\n key = \"'\";\n }\n } else {\n evt.preventDefault();\n this._cursorIndex = -1;\n this.deadKey = true;\n }\n } else {\n this._cursorIndex = -1;\n this.deadKey = true;\n }\n break;\n }\n // Printable characters\n if (key &&\n ((keyCode === -1) || // Direct access\n (keyCode === 32) || // Space\n (keyCode === 34) || // \" add support for single and double quotes\n (keyCode === 39) || // '\n (keyCode > 47 && keyCode < 64) || // Numbers\n (keyCode > 64 && keyCode < 91) || // Letters\n (keyCode > 159 && keyCode < 193) || // Special characters\n (keyCode > 218 && keyCode < 223) || // Special characters\n (keyCode > 95 && keyCode < 112))) { // Numpad\n this._currentKey = key;\n this.onBeforeKeyAddObservable.notifyObservers(this);\n key = this._currentKey;\n if (this._addKey) {\n if (this._isTextHighlightOn) {\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);\n this._textHasChanged();\n this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);\n this._isTextHighlightOn = false;\n this._blinkIsEven = false;\n this._markAsDirty();\n }\n else if (this._cursorOffset === 0) {\n this.text += key;\n } else {\n let insertPosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(insertPosition, insertPosition, key);\n this._textHasChanged();\n }\n }\n }\n }\n\n /** @hidden */\n private _updateValueFromCursorIndex(offset: number) {\n //update the cursor\n this._blinkIsEven = false;\n\n if (this._cursorIndex === -1) {\n this._cursorIndex = offset;\n } else {\n if (this._cursorIndex < this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n }\n else if (this._cursorIndex > this._cursorOffset) {\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\n }\n else {\n this._isTextHighlightOn = false;\n this._markAsDirty();\n return;\n }\n }\n this._isTextHighlightOn = true;\n this._markAsDirty();\n }\n /** @hidden */\n private _processDblClick(evt: PointerInfo) {\n //pre-find the start and end index of the word under cursor, speeds up the rendering\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\n this._endHighlightIndex = this._startHighlightIndex;\n let moveLeft, moveRight;\n do {\n moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0;\n moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;\n } while (moveLeft || moveRight);\n\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n this.onTextHighlightObservable.notifyObservers(this);\n\n this._isTextHighlightOn = true;\n this._clickedCoordinate = null;\n this._blinkIsEven = true;\n this._cursorIndex = -1;\n this._markAsDirty();\n }\n /** @hidden */\n private _selectAllText() {\n this._blinkIsEven = true;\n this._isTextHighlightOn = true;\n\n this._startHighlightIndex = 0;\n this._endHighlightIndex = this._textWrapper.length;\n this._cursorOffset = this._textWrapper.length;\n this._cursorIndex = -1;\n this._markAsDirty();\n }\n\n /**\n * Handles the keyboard event\n * @param evt Defines the KeyboardEvent\n */\n public processKeyboard(evt: IKeyboardEvent): void {\n // process pressed key\n this.processKey(evt.keyCode, evt.key, evt);\n\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\n }\n\n /** @hidden */\n private _onCopyText(ev: ClipboardEvent): void {\n this._isTextHighlightOn = false;\n //when write permission to clipbaord data is denied\n try {\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\n }\n catch { } //pass\n this._host.clipboardData = this._highlightedText;\n }\n /** @hidden */\n private _onCutText(ev: ClipboardEvent): void {\n if (!this._highlightedText) {\n return;\n }\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\n this._textHasChanged();\n this._isTextHighlightOn = false;\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\n //when write permission to clipbaord data is denied\n try {\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\n }\n catch { } //pass\n\n this._host.clipboardData = this._highlightedText;\n this._highlightedText = \"\";\n }\n /** @hidden */\n private _onPasteText(ev: ClipboardEvent): void {\n let data: string = \"\";\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\n data = ev.clipboardData.getData(\"text/plain\");\n }\n else {\n //get the cached data; returns blank string by default\n data = this._host.clipboardData;\n }\n let insertPosition = this._textWrapper.length - this._cursorOffset;\n this._textWrapper.removePart(insertPosition, insertPosition, data);\n this._textHasChanged();\n }\n\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\n context.save();\n\n this._applyStates(context);\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowColor = this.shadowColor;\n context.shadowBlur = this.shadowBlur;\n context.shadowOffsetX = this.shadowOffsetX;\n context.shadowOffsetY = this.shadowOffsetY;\n }\n\n // Background\n if (this._isFocused) {\n if (this._focusedBackground) {\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\n\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\n }\n } else if (this._background) {\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\n\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\n }\n\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n\n if (!this._fontOffset || this._wasDirty) {\n this._fontOffset = Control._GetFontOffset(context.font);\n }\n\n // Text\n let clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);\n if (this.color) {\n context.fillStyle = this.color;\n }\n\n let text = this._beforeRenderText(this._textWrapper);\n\n if (!this._isFocused && !this._textWrapper.text && this._placeholderText) {\n text = new TextWrapper();\n text.text = this._placeholderText;\n\n if (this._placeholderColor) {\n context.fillStyle = this._placeholderColor;\n }\n }\n\n this._textWidth = context.measureText(text.text).width;\n let marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;\n if (this._autoStretchWidth) {\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + \"px\";\n this._autoStretchWidth = true; // setting the width will have reset _autoStretchWidth to false!\n }\n\n let rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2;\n let availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth;\n\n context.save();\n context.beginPath();\n context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height);\n context.clip();\n\n if (this._isFocused && this._textWidth > availableWidth) {\n let textLeft = clipTextLeft - this._textWidth + availableWidth;\n if (!this._scrollLeft) {\n this._scrollLeft = textLeft;\n }\n } else {\n this._scrollLeft = clipTextLeft;\n }\n\n context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);\n\n // Cursor\n if (this._isFocused) {\n\n // Need to move cursor\n if (this._clickedCoordinate) {\n var rightPosition = this._scrollLeft + this._textWidth;\n var absoluteCursorPosition = rightPosition - this._clickedCoordinate;\n var currentSize = 0;\n this._cursorOffset = 0;\n var previousDist = 0;\n do {\n if (this._cursorOffset) {\n previousDist = Math.abs(absoluteCursorPosition - currentSize);\n }\n this._cursorOffset++;\n currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;\n\n } while (currentSize < absoluteCursorPosition && (text.length >= this._cursorOffset));\n\n // Find closest move\n if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {\n this._cursorOffset--;\n }\n\n this._blinkIsEven = false;\n this._clickedCoordinate = null;\n }\n\n // Render cursor\n if (!this._blinkIsEven) {\n let cursorOffsetText = text.substr(text.length - this._cursorOffset);\n let cursorOffsetWidth = context.measureText(cursorOffsetText).width;\n let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth;\n\n if (cursorLeft < clipTextLeft) {\n this._scrollLeft += (clipTextLeft - cursorLeft);\n cursorLeft = clipTextLeft;\n this._markAsDirty();\n } else if (cursorLeft > clipTextLeft + availableWidth) {\n this._scrollLeft += (clipTextLeft + availableWidth - cursorLeft);\n cursorLeft = clipTextLeft + availableWidth;\n this._markAsDirty();\n }\n if (!this._isTextHighlightOn) {\n context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);\n }\n }\n\n clearTimeout(this._blinkTimeout);\n this._blinkTimeout = <any>setTimeout(() => {\n this._blinkIsEven = !this._blinkIsEven;\n this._markAsDirty();\n }, 500);\n\n //show the highlighted text\n if (this._isTextHighlightOn) {\n clearTimeout(this._blinkTimeout);\n let highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;\n let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;\n this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex);\n let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width;\n if (highlightCursorLeft < clipTextLeft) {\n width = width - (clipTextLeft - highlightCursorLeft);\n if (!width) {\n // when using left arrow on text.length > availableWidth;\n // assigns the width of the first letter after clipTextLeft\n width = context.measureText(text.charAt(text.length - this._cursorOffset)).width;\n }\n highlightCursorLeft = clipTextLeft;\n }\n //for transparancy\n context.globalAlpha = this._highligherOpacity;\n context.fillStyle = this._textHighlightColor;\n context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height);\n context.globalAlpha = 1.0;\n }\n }\n context.restore();\n\n // Border\n if (this._thickness) {\n if (this._isFocused) {\n if (this.focusedColor) {\n context.strokeStyle = this.focusedColor;\n }\n } else {\n if (this.color) {\n context.strokeStyle = this.color;\n }\n }\n\n context.lineWidth = this._thickness;\n\n context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2,\n this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness);\n }\n\n context.restore();\n }\n\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\n return false;\n }\n\n if (this.isReadOnly) {\n return true;\n }\n\n this._clickedCoordinate = coordinates.x;\n this._isTextHighlightOn = false;\n this._highlightedText = \"\";\n this._cursorIndex = -1;\n this._isPointerDown = true;\n this._host._capturingControl[pointerId] = this;\n this._focusedBy = (pi.event as IPointerEvent).pointerType;\n if (this._host.focusedControl === this) {\n // Move cursor\n clearTimeout(this._blinkTimeout);\n this._markAsDirty();\n return true;\n }\n if (!this._isEnabled) {\n return false;\n }\n this._host.focusedControl = this;\n\n return true;\n }\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\n this._clickedCoordinate = coordinates.x;\n this._markAsDirty();\n this._updateValueFromCursorIndex(this._cursorOffset);\n }\n super._onPointerMove(target, coordinates, pointerId, pi);\n }\n\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\n\n this._isPointerDown = false;\n delete this._host._capturingControl[pointerId];\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\n }\n\n protected _beforeRenderText(textWrapper: TextWrapper): TextWrapper {\n return textWrapper;\n }\n\n public dispose() {\n super.dispose();\n\n this.onBlurObservable.clear();\n this.onFocusObservable.clear();\n this.onTextChangedObservable.clear();\n this.onTextCopyObservable.clear();\n this.onTextCutObservable.clear();\n this.onTextPasteObservable.clear();\n this.onTextHighlightObservable.clear();\n this.onKeyboardEventProcessedObservable.clear();\n }\n}\nRegisterClass(\"BABYLON.GUI.InputText\", InputText);\n"]}
@@ -157,6 +157,7 @@ export declare class TextBlock extends Control {
157
157
  protected _applyStates(context: ICanvasRenderingContext): void;
158
158
  protected _breakLines(refWidth: number, refHeight: number, context: ICanvasRenderingContext): object[];
159
159
  protected _parseLine(line: string | undefined, context: ICanvasRenderingContext): object;
160
+ private _getCharsToRemove;
160
161
  protected _parseLineEllipsis(line: string | undefined, width: number, context: ICanvasRenderingContext): object;
161
162
  protected _parseLineWordWrap(line: string | undefined, width: number, context: ICanvasRenderingContext): object[];
162
163
  protected _parseLineWordWrapEllipsis(line: string | undefined, width: number, height: number, context: ICanvasRenderingContext): object[];
@@ -415,30 +415,40 @@ var TextBlock = /** @class */ (function (_super) {
415
415
  var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
416
416
  return { text: line, width: lineWidth };
417
417
  };
418
+ //Calculate how many characters approximately we need to remove
419
+ TextBlock.prototype._getCharsToRemove = function (lineWidth, width, lineLength) {
420
+ var diff = lineWidth > width ? lineWidth - width : 0;
421
+ // This isn't exact unless the font is monospaced
422
+ var charWidth = lineWidth / lineLength;
423
+ var removeChars = Math.max(Math.floor(diff / charWidth), 1);
424
+ return removeChars;
425
+ };
418
426
  TextBlock.prototype._parseLineEllipsis = function (line, width, context) {
419
427
  if (line === void 0) { line = ""; }
420
428
  var textMetrics = context.measureText(line);
421
429
  var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
422
- if (lineWidth > width) {
423
- line += "…";
424
- }
430
+ var removeChars = this._getCharsToRemove(lineWidth, width, line.length);
425
431
  // unicode support. split('') does not work with unicode!
426
432
  // make sure Array.from is available
427
433
  var characters = Array.from && Array.from(line);
428
434
  if (!characters) {
429
435
  // no array.from, use the old method
430
436
  while (line.length > 2 && lineWidth > width) {
431
- line = line.slice(0, -2) + "…";
432
- textMetrics = context.measureText(line);
437
+ line = line.slice(0, -removeChars);
438
+ textMetrics = context.measureText(line + "…");
433
439
  lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
440
+ removeChars = this._getCharsToRemove(lineWidth, width, line.length);
434
441
  }
442
+ // Add on the end
443
+ line += "…";
435
444
  }
436
445
  else {
437
446
  while (characters.length && lineWidth > width) {
438
- characters.pop();
439
- line = "".concat(characters.join(""), "...");
447
+ characters.splice(characters.length - removeChars, removeChars);
448
+ line = "".concat(characters.join(""), "\u2026");
440
449
  textMetrics = context.measureText(line);
441
450
  lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
451
+ removeChars = this._getCharsToRemove(lineWidth, width, line.length);
442
452
  }
443
453
  }
444
454
  return { text: line, width: lineWidth };
@@ -1 +1 @@
1
- {"version":3,"file":"textBlock.js","sourceRoot":"","sources":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S,EAAE;iDAGX;IAkBD;QAFC,SAAS,EAAE;8CAIX;IAiBD;QADC,SAAS,EAAE;gDAGX;IAiBD;QADC,SAAS,EAAE;iDAGX;IAyUL,gBAAC;CAAA,AAtiBD,CAA+B,OAAO,GAsiBrC;SAtiBY,SAAS;AAuiBtB,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { Observable } from \"@babylonjs/core/Misc/observable\";\r\nimport { Measure } from \"../measure\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Control } from \"./control\";\r\nimport { RegisterClass } from \"@babylonjs/core/Misc/typeStore\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { serialize } from '@babylonjs/core/Misc/decorators';\r\nimport { ICanvasRenderingContext } from '@babylonjs/core/Engines/ICanvas';\r\nimport { EngineStore } from \"@babylonjs/core/Engines/engineStore\";\r\n\r\n/**\r\n * Enum that determines the text-wrapping mode to use.\r\n */\r\nexport enum TextWrapping {\r\n /**\r\n * Clip the text when it's larger than Control.width; this is the default mode.\r\n */\r\n Clip = 0,\r\n\r\n /**\r\n * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.\r\n */\r\n WordWrap = 1,\r\n\r\n /**\r\n * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.\r\n */\r\n Ellipsis = 2,\r\n\r\n /**\r\n * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .\r\n */\r\n WordWrapEllipsis\r\n}\r\n\r\n/**\r\n * Class used to create text block control\r\n */\r\nexport class TextBlock extends Control {\r\n private _text = \"\";\r\n private _textWrapping = TextWrapping.Clip;\r\n private _textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n private _textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n\r\n private _lines: any[];\r\n private _resizeToFit: boolean = false;\r\n private _lineSpacing: ValueAndUnit = new ValueAndUnit(0);\r\n private _outlineWidth: number = 0;\r\n private _outlineColor: string = \"white\";\r\n private _underline: boolean = false;\r\n private _lineThrough: boolean = false;\r\n /**\r\n * An event triggered after the text is changed\r\n */\r\n public onTextChangedObservable = new Observable<TextBlock>();\r\n\r\n /**\r\n * An event triggered after the text was broken up into lines\r\n */\r\n public onLinesReadyObservable = new Observable<TextBlock>();\r\n\r\n /**\r\n * Function used to split a string into words. By default, a string is split at each space character found\r\n */\r\n public wordSplittingFunction: Nullable<(line: string) => string[]>;\r\n\r\n /**\r\n * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)\r\n */\r\n public get lines(): any[] {\r\n return this._lines;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that the TextBlock will be resized to fit container\r\n */\r\n @serialize()\r\n public get resizeToFit(): boolean {\r\n return this._resizeToFit;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that the TextBlock will be resized to fit container\r\n */\r\n public set resizeToFit(value: boolean) {\r\n if (this._resizeToFit === value) {\r\n return;\r\n }\r\n this._resizeToFit = value;\r\n\r\n if (this._resizeToFit) {\r\n this._width.ignoreAdaptiveScaling = true;\r\n this._height.ignoreAdaptiveScaling = true;\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if text must be wrapped\r\n */\r\n @serialize()\r\n public get textWrapping(): TextWrapping | boolean {\r\n return this._textWrapping;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if text must be wrapped\r\n */\r\n public set textWrapping(value: TextWrapping | boolean) {\r\n if (this._textWrapping === value) {\r\n return;\r\n }\r\n this._textWrapping = +value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets text to display\r\n */\r\n @serialize()\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n /**\r\n * Gets or sets text to display\r\n */\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n this._text = value + \"\"; // Making sure it is a text\r\n this._markAsDirty();\r\n\r\n this.onTextChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)\r\n */\r\n @serialize()\r\n public get textHorizontalAlignment(): number {\r\n return this._textHorizontalAlignment;\r\n }\r\n\r\n /**\r\n * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)\r\n */\r\n public set textHorizontalAlignment(value: number) {\r\n if (this._textHorizontalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._textHorizontalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)\r\n */\r\n @serialize()\r\n public get textVerticalAlignment(): number {\r\n return this._textVerticalAlignment;\r\n }\r\n\r\n /**\r\n * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)\r\n */\r\n public set textVerticalAlignment(value: number) {\r\n if (this._textVerticalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._textVerticalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets line spacing value\r\n */\r\n @serialize()\r\n public set lineSpacing(value: string | number) {\r\n if (this._lineSpacing.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets line spacing value\r\n */\r\n public get lineSpacing(): string | number {\r\n return this._lineSpacing.toString(this._host);\r\n }\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n @serialize()\r\n public get outlineWidth(): number {\r\n return this._outlineWidth;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n public set outlineWidth(value: number) {\r\n if (this._outlineWidth === value) {\r\n return;\r\n }\r\n this._outlineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that text must have underline\r\n */\r\n @serialize()\r\n\r\n public get underline(): boolean {\r\n return this._underline;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that text must have underline\r\n */\r\n public set underline(value: boolean) {\r\n if (this._underline === value) {\r\n return;\r\n }\r\n this._underline = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that text must be crossed out\r\n */\r\n @serialize()\r\n public get lineThrough(): boolean {\r\n return this._lineThrough;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that text must be crossed out\r\n */\r\n public set lineThrough(value: boolean) {\r\n if (this._lineThrough === value) {\r\n return;\r\n }\r\n this._lineThrough = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n @serialize()\r\n public get outlineColor(): string {\r\n return this._outlineColor;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n public set outlineColor(value: string) {\r\n if (this._outlineColor === value) {\r\n return;\r\n }\r\n this._outlineColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new TextBlock object\r\n * @param name defines the name of the control\r\n * @param text defines the text to display (emptry string by default)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the control\r\n */\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"TextBlock\";\r\n }\r\n\r\n protected _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (!this._fontOffset || this.isDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n super._processMeasures(parentMeasure, context);\r\n\r\n // Prepare lines\r\n this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context);\r\n this.onLinesReadyObservable.notifyObservers(this);\r\n\r\n let maxLineWidth: number = 0;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (line.width > maxLineWidth) {\r\n maxLineWidth = line.width;\r\n }\r\n }\r\n\r\n if (this._resizeToFit) {\r\n if (this._textWrapping === TextWrapping.Clip) {\r\n let newWidth = (this._paddingLeftInPixels + this._paddingRightInPixels + maxLineWidth) | 0;\r\n if (newWidth !== this._width.internalValue) {\r\n this._width.updateInPlace(newWidth, ValueAndUnit.UNITMODE_PIXEL);\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n let newHeight = (this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length) | 0;\r\n\r\n if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {\r\n let lineSpacing = 0;\r\n if (this._lineSpacing.isPixel) {\r\n lineSpacing = this._lineSpacing.getValue(this._host);\r\n } else {\r\n lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n newHeight += (this._lines.length - 1) * lineSpacing;\r\n }\r\n\r\n if (newHeight !== this._height.internalValue) {\r\n this._height.updateInPlace(newHeight, ValueAndUnit.UNITMODE_PIXEL);\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n }\r\n\r\n private _drawText(text: string, textWidth: number, y: number, context: ICanvasRenderingContext): void {\r\n var width = this._currentMeasure.width;\r\n var x = 0;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x = 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x = width - textWidth;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x = (width - textWidth) / 2;\r\n break;\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n if (this.outlineWidth) {\r\n context.strokeText(text, this._currentMeasure.left + x, y);\r\n }\r\n context.fillText(text, this._currentMeasure.left + x, y);\r\n\r\n if (this._underline) {\r\n context.beginPath();\r\n context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);\r\n context.moveTo(this._currentMeasure.left + x, y + 3);\r\n context.lineTo(this._currentMeasure.left + x + textWidth, y + 3);\r\n context.stroke();\r\n context.closePath();\r\n }\r\n\r\n if (this._lineThrough) {\r\n context.beginPath();\r\n context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);\r\n context.moveTo(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3);\r\n context.lineTo(this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3);\r\n context.stroke();\r\n context.closePath();\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n // Render lines\r\n this._renderLines(context);\r\n\r\n context.restore();\r\n }\r\n\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n super._applyStates(context);\r\n if (this.outlineWidth) {\r\n context.lineWidth = this.outlineWidth;\r\n context.strokeStyle = this.outlineColor;\r\n context.lineJoin = 'miter';\r\n context.miterLimit = 2;\r\n }\r\n }\r\n\r\n protected _breakLines(refWidth: number, refHeight: number, context: ICanvasRenderingContext): object[] {\r\n var lines = [];\r\n var _lines = this.text.split(\"\\n\");\r\n\r\n if (this._textWrapping === TextWrapping.Ellipsis) {\r\n for (var _line of _lines) {\r\n lines.push(this._parseLineEllipsis(_line, refWidth, context));\r\n }\r\n } else if (this._textWrapping === TextWrapping.WordWrap) {\r\n for (var _line of _lines) {\r\n lines.push(...this._parseLineWordWrap(_line, refWidth, context));\r\n }\r\n } else if (this._textWrapping === TextWrapping.WordWrapEllipsis) {\r\n for (var _line of _lines) {\r\n lines.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight!, context));\r\n }\r\n } else {\r\n for (var _line of _lines) {\r\n lines.push(this._parseLine(_line, context));\r\n }\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLine(line: string = \"\", context: ICanvasRenderingContext): object {\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n return { text: line, width: lineWidth };\r\n }\r\n\r\n protected _parseLineEllipsis(line: string = \"\", width: number, context: ICanvasRenderingContext): object {\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n if (lineWidth > width) {\r\n line += \"…\";\r\n }\r\n // unicode support. split('') does not work with unicode!\r\n // make sure Array.from is available\r\n const characters = Array.from && Array.from(line);\r\n if (!characters) {\r\n // no array.from, use the old method\r\n while (line.length > 2 && lineWidth > width) {\r\n line = line.slice(0, -2) + \"…\";\r\n textMetrics = context.measureText(line);\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n }\r\n } else {\r\n while (characters.length && lineWidth > width) {\r\n characters.pop();\r\n line = `${characters.join(\"\")}...`;\r\n textMetrics = context.measureText(line);\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n }\r\n }\r\n\r\n return { text: line, width: lineWidth };\r\n }\r\n\r\n protected _parseLineWordWrap(line: string = \"\", width: number, context: ICanvasRenderingContext): object[] {\r\n var lines = [];\r\n var words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(\" \");\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n for (var n = 0; n < words.length; n++) {\r\n var testLine = n > 0 ? line + \" \" + words[n] : words[0];\r\n var metrics = context.measureText(testLine);\r\n var testWidth = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);\r\n if (testWidth > width && n > 0) {\r\n lines.push({ text: line, width: lineWidth });\r\n line = words[n];\r\n textMetrics = context.measureText(line);\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n } else {\r\n lineWidth = testWidth;\r\n line = testLine;\r\n }\r\n }\r\n lines.push({ text: line, width: lineWidth });\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLineWordWrapEllipsis(line: string = \"\", width: number, height: number, context: ICanvasRenderingContext): object[] {\r\n var lines = this._parseLineWordWrap(line, width, context);\r\n for (var n = 1; n <= lines.length; n++) {\r\n const currentHeight = this._computeHeightForLinesOf(n);\r\n if (currentHeight > height && n > 1) {\r\n var lastLine = lines[n - 2] as {text: string; width: number};\r\n var currentLine = lines[n - 1] as {text: string; width: number};\r\n lines[n - 2] = this._parseLineEllipsis(`${lastLine.text + currentLine.text}`, width, context);\r\n var linesToRemove = lines.length - n + 1;\r\n for (var i = 0; i < linesToRemove; i++) {\r\n lines.pop();\r\n }\r\n return lines;\r\n }\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n protected _renderLines(context: ICanvasRenderingContext): void {\r\n var height = this._currentMeasure.height;\r\n var rootY = 0;\r\n switch (this._textVerticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n rootY = this._fontOffset.ascent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;\r\n break;\r\n }\r\n\r\n rootY += this._currentMeasure.top;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (i !== 0 && this._lineSpacing.internalValue !== 0) {\r\n if (this._lineSpacing.isPixel) {\r\n rootY += this._lineSpacing.getValue(this._host);\r\n } else {\r\n rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n }\r\n\r\n this._drawText(line.text, line.width, rootY, context);\r\n rootY += this._fontOffset.height;\r\n }\r\n }\r\n\r\n private _computeHeightForLinesOf(lineCount: number): number {\r\n let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount;\r\n\r\n if (lineCount > 0 && this._lineSpacing.internalValue !== 0) {\r\n let lineSpacing = 0;\r\n if (this._lineSpacing.isPixel) {\r\n lineSpacing = this._lineSpacing.getValue(this._host);\r\n } else {\r\n lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n newHeight += (lineCount - 1) * lineSpacing;\r\n }\r\n\r\n return newHeight;\r\n }\r\n\r\n /**\r\n * Given a width constraint applied on the text block, find the expected height\r\n * @returns expected height\r\n */\r\n public computeExpectedHeight(): number {\r\n if (this.text && this.widthInPixels) {\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const context = EngineStore.LastCreatedEngine?.createCanvas(0, 0).getContext(\"2d\");\r\n if (context) {\r\n this._applyStates(context);\r\n if (!this._fontOffset) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n const lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context);\r\n return this._computeHeightForLinesOf(lines.length);\r\n }\r\n }\r\n return 0;\r\n }\r\n\r\n dispose(): void {\r\n super.dispose();\r\n\r\n this.onTextChangedObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.TextBlock\", TextBlock);\r\n"]}
1
+ {"version":3,"file":"textBlock.js","sourceRoot":"","sources":["../../../../sourceES6/gui/src/2D/controls/textBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,C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CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAO,CAAC,CAAC;gBAC/N,OAAO,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aACtD;SACJ;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAED,2BAAO,GAAP;QACI,iBAAM,OAAO,WAAE,CAAC;QAEhB,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IA5gBD;QADC,SAAS,EAAE;gDAGX;IAuBD;QADC,SAAS,EAAE;iDAGX;IAiBD;QADC,SAAS,EAAE;yCAGX;IAmBD;QADC,SAAS,EAAE;4DAGX;IAkBD;QADC,SAAS,EAAE;0DAGX;IAkBD;QADC,SAAS,EAAE;gDAKX;IAaD;QADC,SAAS,EAAE;iDAGX;IAkBD;QAFC,SAAS,EAAE;8CAIX;IAiBD;QADC,SAAS,EAAE;gDAGX;IAiBD;QADC,SAAS,EAAE;iDAGX;IAuVL,gBAAC;CAAA,AApjBD,CAA+B,OAAO,GAojBrC;SApjBY,SAAS;AAqjBtB,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { Observable } from \"@babylonjs/core/Misc/observable\";\r\nimport { Measure } from \"../measure\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Control } from \"./control\";\r\nimport { RegisterClass } from \"@babylonjs/core/Misc/typeStore\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { serialize } from '@babylonjs/core/Misc/decorators';\r\nimport { ICanvasRenderingContext } from '@babylonjs/core/Engines/ICanvas';\r\nimport { EngineStore } from \"@babylonjs/core/Engines/engineStore\";\r\n\r\n/**\r\n * Enum that determines the text-wrapping mode to use.\r\n */\r\nexport enum TextWrapping {\r\n /**\r\n * Clip the text when it's larger than Control.width; this is the default mode.\r\n */\r\n Clip = 0,\r\n\r\n /**\r\n * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.\r\n */\r\n WordWrap = 1,\r\n\r\n /**\r\n * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.\r\n */\r\n Ellipsis = 2,\r\n\r\n /**\r\n * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .\r\n */\r\n WordWrapEllipsis\r\n}\r\n\r\n/**\r\n * Class used to create text block control\r\n */\r\nexport class TextBlock extends Control {\r\n private _text = \"\";\r\n private _textWrapping = TextWrapping.Clip;\r\n private _textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n private _textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n\r\n private _lines: any[];\r\n private _resizeToFit: boolean = false;\r\n private _lineSpacing: ValueAndUnit = new ValueAndUnit(0);\r\n private _outlineWidth: number = 0;\r\n private _outlineColor: string = \"white\";\r\n private _underline: boolean = false;\r\n private _lineThrough: boolean = false;\r\n /**\r\n * An event triggered after the text is changed\r\n */\r\n public onTextChangedObservable = new Observable<TextBlock>();\r\n\r\n /**\r\n * An event triggered after the text was broken up into lines\r\n */\r\n public onLinesReadyObservable = new Observable<TextBlock>();\r\n\r\n /**\r\n * Function used to split a string into words. By default, a string is split at each space character found\r\n */\r\n public wordSplittingFunction: Nullable<(line: string) => string[]>;\r\n\r\n /**\r\n * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)\r\n */\r\n public get lines(): any[] {\r\n return this._lines;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that the TextBlock will be resized to fit container\r\n */\r\n @serialize()\r\n public get resizeToFit(): boolean {\r\n return this._resizeToFit;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that the TextBlock will be resized to fit container\r\n */\r\n public set resizeToFit(value: boolean) {\r\n if (this._resizeToFit === value) {\r\n return;\r\n }\r\n this._resizeToFit = value;\r\n\r\n if (this._resizeToFit) {\r\n this._width.ignoreAdaptiveScaling = true;\r\n this._height.ignoreAdaptiveScaling = true;\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if text must be wrapped\r\n */\r\n @serialize()\r\n public get textWrapping(): TextWrapping | boolean {\r\n return this._textWrapping;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if text must be wrapped\r\n */\r\n public set textWrapping(value: TextWrapping | boolean) {\r\n if (this._textWrapping === value) {\r\n return;\r\n }\r\n this._textWrapping = +value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets text to display\r\n */\r\n @serialize()\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n /**\r\n * Gets or sets text to display\r\n */\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n this._text = value + \"\"; // Making sure it is a text\r\n this._markAsDirty();\r\n\r\n this.onTextChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)\r\n */\r\n @serialize()\r\n public get textHorizontalAlignment(): number {\r\n return this._textHorizontalAlignment;\r\n }\r\n\r\n /**\r\n * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)\r\n */\r\n public set textHorizontalAlignment(value: number) {\r\n if (this._textHorizontalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._textHorizontalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)\r\n */\r\n @serialize()\r\n public get textVerticalAlignment(): number {\r\n return this._textVerticalAlignment;\r\n }\r\n\r\n /**\r\n * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)\r\n */\r\n public set textVerticalAlignment(value: number) {\r\n if (this._textVerticalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._textVerticalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets line spacing value\r\n */\r\n @serialize()\r\n public set lineSpacing(value: string | number) {\r\n if (this._lineSpacing.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets line spacing value\r\n */\r\n public get lineSpacing(): string | number {\r\n return this._lineSpacing.toString(this._host);\r\n }\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n @serialize()\r\n public get outlineWidth(): number {\r\n return this._outlineWidth;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n public set outlineWidth(value: number) {\r\n if (this._outlineWidth === value) {\r\n return;\r\n }\r\n this._outlineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that text must have underline\r\n */\r\n @serialize()\r\n\r\n public get underline(): boolean {\r\n return this._underline;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that text must have underline\r\n */\r\n public set underline(value: boolean) {\r\n if (this._underline === value) {\r\n return;\r\n }\r\n this._underline = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that text must be crossed out\r\n */\r\n @serialize()\r\n public get lineThrough(): boolean {\r\n return this._lineThrough;\r\n }\r\n\r\n /**\r\n * Gets or sets an boolean indicating that text must be crossed out\r\n */\r\n public set lineThrough(value: boolean) {\r\n if (this._lineThrough === value) {\r\n return;\r\n }\r\n this._lineThrough = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n @serialize()\r\n public get outlineColor(): string {\r\n return this._outlineColor;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n public set outlineColor(value: string) {\r\n if (this._outlineColor === value) {\r\n return;\r\n }\r\n this._outlineColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new TextBlock object\r\n * @param name defines the name of the control\r\n * @param text defines the text to display (emptry string by default)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the control\r\n */\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"TextBlock\";\r\n }\r\n\r\n protected _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (!this._fontOffset || this.isDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n super._processMeasures(parentMeasure, context);\r\n\r\n // Prepare lines\r\n this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context);\r\n this.onLinesReadyObservable.notifyObservers(this);\r\n\r\n let maxLineWidth: number = 0;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (line.width > maxLineWidth) {\r\n maxLineWidth = line.width;\r\n }\r\n }\r\n\r\n if (this._resizeToFit) {\r\n if (this._textWrapping === TextWrapping.Clip) {\r\n let newWidth = (this._paddingLeftInPixels + this._paddingRightInPixels + maxLineWidth) | 0;\r\n if (newWidth !== this._width.internalValue) {\r\n this._width.updateInPlace(newWidth, ValueAndUnit.UNITMODE_PIXEL);\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n let newHeight = (this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length) | 0;\r\n\r\n if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {\r\n let lineSpacing = 0;\r\n if (this._lineSpacing.isPixel) {\r\n lineSpacing = this._lineSpacing.getValue(this._host);\r\n } else {\r\n lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n newHeight += (this._lines.length - 1) * lineSpacing;\r\n }\r\n\r\n if (newHeight !== this._height.internalValue) {\r\n this._height.updateInPlace(newHeight, ValueAndUnit.UNITMODE_PIXEL);\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n }\r\n\r\n private _drawText(text: string, textWidth: number, y: number, context: ICanvasRenderingContext): void {\r\n var width = this._currentMeasure.width;\r\n var x = 0;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x = 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x = width - textWidth;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x = (width - textWidth) / 2;\r\n break;\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n if (this.outlineWidth) {\r\n context.strokeText(text, this._currentMeasure.left + x, y);\r\n }\r\n context.fillText(text, this._currentMeasure.left + x, y);\r\n\r\n if (this._underline) {\r\n context.beginPath();\r\n context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);\r\n context.moveTo(this._currentMeasure.left + x, y + 3);\r\n context.lineTo(this._currentMeasure.left + x + textWidth, y + 3);\r\n context.stroke();\r\n context.closePath();\r\n }\r\n\r\n if (this._lineThrough) {\r\n context.beginPath();\r\n context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);\r\n context.moveTo(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3);\r\n context.lineTo(this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3);\r\n context.stroke();\r\n context.closePath();\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n // Render lines\r\n this._renderLines(context);\r\n\r\n context.restore();\r\n }\r\n\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n super._applyStates(context);\r\n if (this.outlineWidth) {\r\n context.lineWidth = this.outlineWidth;\r\n context.strokeStyle = this.outlineColor;\r\n context.lineJoin = 'miter';\r\n context.miterLimit = 2;\r\n }\r\n }\r\n\r\n protected _breakLines(refWidth: number, refHeight: number, context: ICanvasRenderingContext): object[] {\r\n var lines = [];\r\n var _lines = this.text.split(\"\\n\");\r\n\r\n if (this._textWrapping === TextWrapping.Ellipsis) {\r\n for (var _line of _lines) {\r\n lines.push(this._parseLineEllipsis(_line, refWidth, context));\r\n }\r\n } else if (this._textWrapping === TextWrapping.WordWrap) {\r\n for (var _line of _lines) {\r\n lines.push(...this._parseLineWordWrap(_line, refWidth, context));\r\n }\r\n } else if (this._textWrapping === TextWrapping.WordWrapEllipsis) {\r\n for (var _line of _lines) {\r\n lines.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight!, context));\r\n }\r\n } else {\r\n for (var _line of _lines) {\r\n lines.push(this._parseLine(_line, context));\r\n }\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLine(line: string = \"\", context: ICanvasRenderingContext): object {\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n return { text: line, width: lineWidth };\r\n }\r\n\r\n //Calculate how many characters approximately we need to remove\r\n private _getCharsToRemove(lineWidth : number, width : number, lineLength : number) {\r\n let diff = lineWidth > width ? lineWidth - width : 0;\r\n // This isn't exact unless the font is monospaced\r\n let charWidth = lineWidth / lineLength;\r\n let removeChars = Math.max(Math.floor(diff / charWidth), 1);\r\n return removeChars;\r\n }\r\n\r\n protected _parseLineEllipsis(line: string = \"\", width: number, context: ICanvasRenderingContext): object {\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n let removeChars = this._getCharsToRemove(lineWidth, width, line.length);\r\n\r\n // unicode support. split('') does not work with unicode!\r\n // make sure Array.from is available\r\n const characters = Array.from && Array.from(line);\r\n if (!characters) {\r\n // no array.from, use the old method\r\n while (line.length > 2 && lineWidth > width) {\r\n line = line.slice(0, -removeChars);\r\n textMetrics = context.measureText(line + \"…\");\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n removeChars = this._getCharsToRemove(lineWidth, width, line.length);\r\n }\r\n // Add on the end\r\n line += \"…\";\r\n } else {\r\n while (characters.length && lineWidth > width) {\r\n characters.splice(characters.length - removeChars, removeChars);\r\n line = `${characters.join(\"\")}…`;\r\n textMetrics = context.measureText(line);\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n removeChars = this._getCharsToRemove(lineWidth, width, line.length);\r\n }\r\n }\r\n\r\n return { text: line, width: lineWidth };\r\n }\r\n\r\n protected _parseLineWordWrap(line: string = \"\", width: number, context: ICanvasRenderingContext): object[] {\r\n var lines = [];\r\n var words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(\" \");\r\n var textMetrics = context.measureText(line);\r\n var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n\r\n for (var n = 0; n < words.length; n++) {\r\n var testLine = n > 0 ? line + \" \" + words[n] : words[0];\r\n var metrics = context.measureText(testLine);\r\n var testWidth = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);\r\n if (testWidth > width && n > 0) {\r\n lines.push({ text: line, width: lineWidth });\r\n line = words[n];\r\n textMetrics = context.measureText(line);\r\n lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);\r\n } else {\r\n lineWidth = testWidth;\r\n line = testLine;\r\n }\r\n }\r\n lines.push({ text: line, width: lineWidth });\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLineWordWrapEllipsis(line: string = \"\", width: number, height: number, context: ICanvasRenderingContext): object[] {\r\n var lines = this._parseLineWordWrap(line, width, context);\r\n for (var n = 1; n <= lines.length; n++) {\r\n const currentHeight = this._computeHeightForLinesOf(n);\r\n if (currentHeight > height && n > 1) {\r\n var lastLine = lines[n - 2] as {text: string; width: number};\r\n var currentLine = lines[n - 1] as {text: string; width: number};\r\n lines[n - 2] = this._parseLineEllipsis(`${lastLine.text + currentLine.text}`, width, context);\r\n var linesToRemove = lines.length - n + 1;\r\n for (var i = 0; i < linesToRemove; i++) {\r\n lines.pop();\r\n }\r\n return lines;\r\n }\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n protected _renderLines(context: ICanvasRenderingContext): void {\r\n var height = this._currentMeasure.height;\r\n var rootY = 0;\r\n switch (this._textVerticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n rootY = this._fontOffset.ascent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;\r\n break;\r\n }\r\n\r\n rootY += this._currentMeasure.top;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (i !== 0 && this._lineSpacing.internalValue !== 0) {\r\n if (this._lineSpacing.isPixel) {\r\n rootY += this._lineSpacing.getValue(this._host);\r\n } else {\r\n rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n }\r\n\r\n this._drawText(line.text, line.width, rootY, context);\r\n rootY += this._fontOffset.height;\r\n }\r\n }\r\n\r\n private _computeHeightForLinesOf(lineCount: number): number {\r\n let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount;\r\n\r\n if (lineCount > 0 && this._lineSpacing.internalValue !== 0) {\r\n let lineSpacing = 0;\r\n if (this._lineSpacing.isPixel) {\r\n lineSpacing = this._lineSpacing.getValue(this._host);\r\n } else {\r\n lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n newHeight += (lineCount - 1) * lineSpacing;\r\n }\r\n\r\n return newHeight;\r\n }\r\n\r\n /**\r\n * Given a width constraint applied on the text block, find the expected height\r\n * @returns expected height\r\n */\r\n public computeExpectedHeight(): number {\r\n if (this.text && this.widthInPixels) {\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const context = EngineStore.LastCreatedEngine?.createCanvas(0, 0).getContext(\"2d\");\r\n if (context) {\r\n this._applyStates(context);\r\n if (!this._fontOffset) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n const lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context);\r\n return this._computeHeightForLinesOf(lines.length);\r\n }\r\n }\r\n return 0;\r\n }\r\n\r\n dispose(): void {\r\n super.dispose();\r\n\r\n this.onTextChangedObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.TextBlock\", TextBlock);\r\n"]}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "name": "@babylonjs/gui",
6
6
  "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
7
- "version": "5.0.0-beta.10",
7
+ "version": "5.0.0-beta.11",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -326,7 +326,7 @@
326
326
  ],
327
327
  "license": "Apache-2.0",
328
328
  "dependencies": {
329
- "@babylonjs/core": "5.0.0-beta.10",
329
+ "@babylonjs/core": "5.0.0-beta.11",
330
330
  "tslib": "^2.3.1"
331
331
  },
332
332
  "engines": {