Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to create input text control

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new InputTextArea

    Parameters

    • Optional name: string

      defines the control name

    • Optional text: string

      defines the text of the control

    Returns InputTextArea

Properties

clipChildren: boolean

Gets or sets a boolean indicating if the children are clipped to the current control bounds. Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children

clipContent: boolean

Gets or sets a boolean indicating that control content must be clipped Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children

disableMobilePrompt: boolean

Force disable prompt on mobile device

fixedRatio: number

Gets or sets a fixed ratio for this control. When different from 0, the ratio is used to compute the "second" dimension. The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the second dimension is computed as first dimension * fixedRatio

hoverCursor: string

Gets or sets the cursor to use when the control is hovered

isFocusInvisible: boolean

Gets or sets a boolean indicating if the control can be focusable

isHitTestVisible: boolean

Gets or sets a boolean indicating if the control can be hit with pointer events

isPointerBlocker: boolean

Gets or sets a boolean indicating if the control can block pointer events. False by default except on the following controls:

  • Button controls (Button, RadioButton, ToggleButton)
  • Checkbox
  • ColorPicker
  • InputText
  • Slider
metadata: any

Gets or sets an object used to store user defined information for the node

name?: string

defines the name of the control

onAfterDrawObservable: Observable<Control>

An event triggered after the control was drawn

onBeforeDrawObservable: Observable<Control>

An event triggered before drawing the control

onBeforeKeyAddObservable: Observable<InputText>

BABYLON.Observable raised just before an entered character is to be added

onBlurObservable: Observable<InputText>

BABYLON.Observable raised when the control loses the focus

onDirtyObservable: Observable<Control>

An event triggered when the control is marked as dirty

onDisposeObservable: Observable<Control>

An event triggered when the control has been disposed

onFocusObservable: Observable<InputText>

BABYLON.Observable raised when the control gets the focus

onKeyboardEventProcessedObservable: Observable<IKeyboardEvent>

BABYLON.Observable raised when a key event was processed

onLinesReadyObservable: Observable<InputTextArea>

An event triggered after the text was broken up into lines

onPointerClickObservable: Observable<Vector2WithInfo>

An event triggered when a control is clicked on

onPointerDownObservable: Observable<Vector2WithInfo>

An event triggered when the pointer taps the control

onPointerEnterObservable: Observable<Control>

An event triggered when pointer enters the control

onPointerMoveObservable: Observable<Vector2>

An event triggered when the pointer moves over the control.

onPointerOutObservable: Observable<Control>

An event triggered when the pointer moves out of the control.

onPointerUpObservable: Observable<Vector2WithInfo>

An event triggered when pointer up

onTextChangedObservable: Observable<InputText>

BABYLON.Observable raised when the text changes

onTextCopyObservable: Observable<InputText>

Observable raised when copy event is triggered

onTextCutObservable: Observable<InputText>

BABYLON.Observable raised when cut event is triggered

onTextHighlightObservable: Observable<InputText>

Observable raised when the text is highlighted

onTextPasteObservable: Observable<InputText>

BABYLON.Observable raised when paste event is triggered

onWheelObservable: Observable<Vector2>

An event triggered when pointer wheel is scrolled

overlapDeltaMultiplier?: number

Gets/sets the deoverlap movement multiplier

overlapGroup?: number

Gets/sets the overlap group of the control. Controls with overlapGroup set to a number can be deoverlapped. Controls with overlapGroup set to undefined are not deoverlapped.

see

https://doc.babylonjs.com/how_to/gui#deoverlapping

Gets or sets the control parent

promptMessage: string

Gets or sets a string representing the message displayed on mobile when the control gets the focus

uniqueId: number

Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container

useBitmapCache: boolean

Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)

AddHeader: (control: Control, text: string, size: string | number, options: { controlFirst: boolean; isHorizontal: boolean }) => any

Type declaration

    • (control: Control, text: string, size: string | number, options: { controlFirst: boolean; isHorizontal: boolean }): any
    • Parameters

      • control: Control
      • text: string
      • size: string | number
      • options: { controlFirst: boolean; isHorizontal: boolean }
        • controlFirst: boolean
        • isHorizontal: boolean

      Returns any

AllowAlphaInheritance: boolean

Gets or sets a boolean indicating if alpha must be an inherited value (false by default)

Accessors

  • get addKey(): boolean
  • set addKey(flag: boolean): void
  • Gets or sets if the current key should be added

    Returns boolean

  • Gets or sets if the current key should be added

    Parameters

    • flag: boolean

    Returns void

  • get alpha(): number
  • set alpha(value: number): void
  • Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)

    Returns number

  • Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)

    Parameters

    • value: number

    Returns void

  • get autoStretchHeight(): boolean
  • set autoStretchHeight(value: boolean): void
  • Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text

    Returns boolean

  • Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text

    Parameters

    • value: boolean

    Returns void

  • get autoStretchWidth(): boolean
  • set autoStretchWidth(value: boolean): void
  • Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text

    Returns boolean

  • Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text

    Parameters

    • value: boolean

    Returns void

  • get background(): string
  • set background(value: string): void
  • Gets or sets the background color

    Returns string

  • Gets or sets the background color

    Parameters

    • value: string

    Returns void

  • get centerX(): number
  • Gets the center coordinate on X axis

    Returns number

  • get centerY(): number
  • Gets the center coordinate on Y axis

    Returns number

  • get color(): string
  • set color(value: string): void
  • Gets or sets foreground color

    Returns string

  • Gets or sets foreground color

    Parameters

    • value: string

    Returns void

  • get currentKey(): string
  • set currentKey(key: string): void
  • Gets or sets the value of the current key being entered

    Returns string

  • Gets or sets the value of the current key being entered

    Parameters

    • key: string

    Returns void

  • get deadKey(): boolean
  • set deadKey(flag: boolean): void
  • Gets or sets the dead key flag

    Returns boolean

  • Gets or sets the dead key flag

    Parameters

    • flag: boolean

    Returns void

  • get descendantsOnlyPadding(): boolean
  • set descendantsOnlyPadding(value: boolean): void
  • Gets or sets a value indicating the padding should work like in CSS. Basically, it will add the padding amount on each side of the parent control for its children.

    Returns boolean

  • Gets or sets a value indicating the padding should work like in CSS. Basically, it will add the padding amount on each side of the parent control for its children.

    Parameters

    • value: boolean

    Returns void

  • get disabledColor(): string
  • set disabledColor(value: string): void
  • Gets or sets background color of control if it's disabled. Only applies to Button class.

    Returns string

  • Gets or sets background color of control if it's disabled. Only applies to Button class.

    Parameters

    • value: string

    Returns void

  • get disabledColorItem(): string
  • set disabledColorItem(value: string): void
  • Gets or sets front color of control if it's disabled. Only applies to Checkbox class.

    Returns string

  • Gets or sets front color of control if it's disabled. Only applies to Checkbox class.

    Parameters

    • value: string

    Returns void

  • get focusedBackground(): string
  • set focusedBackground(value: string): void
  • Gets or sets the background color when focused

    Returns string

  • Gets or sets the background color when focused

    Parameters

    • value: string

    Returns void

  • get focusedColor(): string
  • set focusedColor(value: string): void
  • Gets or sets the background color when focused

    Returns string

  • Gets or sets the background color when focused

    Parameters

    • value: string

    Returns void

  • get fontFamily(): string
  • set fontFamily(value: string): void
  • Gets or set font family

    Returns string

  • Gets or set font family

    Parameters

    • value: string

    Returns void

  • get fontOffset(): { ascent: number; descent: number; height: number }
  • set fontOffset(offset: { ascent: number; descent: number; height: number }): void
  • Gets or set information about font offsets (used to render and align text)

    Returns { ascent: number; descent: number; height: number }

    • ascent: number
    • descent: number
    • height: number
  • Gets or set information about font offsets (used to render and align text)

    Parameters

    • offset: { ascent: number; descent: number; height: number }
      • ascent: number
      • descent: number
      • height: number

    Returns void

  • get fontSize(): string | number
  • set fontSize(value: string | number): void
  • Gets or sets font size

    Returns string | number

  • Gets or sets font size

    Parameters

    • value: string | number

    Returns void

  • get fontSizeInPixels(): number
  • set fontSizeInPixels(value: number): void
  • Gets or sets font size in pixels

    Returns number

  • Gets or sets font size in pixels

    Parameters

    • value: number

    Returns void

  • get fontStyle(): string
  • set fontStyle(value: string): void
  • Gets or sets font style

    Returns string

  • Gets or sets font style

    Parameters

    • value: string

    Returns void

  • get fontWeight(): string
  • set fontWeight(value: string): void
  • Gets or sets font weight

    Returns string

  • Gets or sets font weight

    Parameters

    • value: string

    Returns void

  • set height(value: string | number): void
  • Parameters

    • value: string | number

    Returns void

  • get heightInPixels(): number
  • set heightInPixels(value: number): void
  • get highligherOpacity(): number
  • set highligherOpacity(value: number): void
  • Gets or sets the text highlighter transparency; default: 0.4

    Returns number

  • Gets or sets the text highlighter transparency; default: 0.4

    Parameters

    • value: number

    Returns void

  • get highlightColor(): string
  • set highlightColor(value: string): void
  • Gets or sets a string defining the color to use for highlighting this control

    Returns string

  • Gets or sets a string defining the color to use for highlighting this control

    Parameters

    • value: string

    Returns void

  • get highlightLineWidth(): number
  • set highlightLineWidth(value: number): void
  • Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)

    Returns number

  • Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)

    Parameters

    • value: number

    Returns void

  • get highlightedText(): string
  • set highlightedText(text: string): void
  • Gets or sets the highlight text

    Returns string

  • Gets or sets the highlight text

    Parameters

    • text: string

    Returns void

  • get horizontalAlignment(): number
  • set horizontalAlignment(value: number): void
  • Get the hosting AdvancedDynamicTexture

    Returns AdvancedDynamicTexture

  • get isDirty(): boolean
  • Gets a boolean indicating that the control needs to update its rendering

    Returns boolean

  • get isEnabled(): boolean
  • set isEnabled(value: boolean): void
  • Gets or sets if control is Enabled

    Returns boolean

  • Gets or sets if control is Enabled

    Parameters

    • value: boolean

    Returns void

  • get isHighlighted(): boolean
  • set isHighlighted(value: boolean): void
  • Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)

    Returns boolean

  • Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)

    Parameters

    • value: boolean

    Returns void

  • get isReadOnly(): boolean
  • set isReadOnly(value: boolean): void
  • Gets or sets a boolean indicating if the control is readonly (default: false). A readonly control will still raise pointer events but will not react to them

    Returns boolean

  • Gets or sets a boolean indicating if the control is readonly (default: false). A readonly control will still raise pointer events but will not react to them

    Parameters

    • value: boolean

    Returns void

  • get isVisible(): boolean
  • set isVisible(value: boolean): void
  • Gets or sets a boolean indicating if the control is visible

    Returns boolean

  • Gets or sets a boolean indicating if the control is visible

    Parameters

    • value: boolean

    Returns void

  • get left(): string | number
  • set left(value: string | number): void
  • get leftInPixels(): number
  • set leftInPixels(value: number): void
  • get linkOffsetX(): string | number
  • set linkOffsetX(value: string | number): void
  • get linkOffsetXInPixels(): number
  • set linkOffsetXInPixels(value: number): void
  • get linkOffsetY(): string | number
  • set linkOffsetY(value: string | number): void
  • get linkOffsetYInPixels(): number
  • set linkOffsetYInPixels(value: number): void
  • Gets the current linked mesh (or null if none)

    Returns Nullable<TransformNode>

  • get margin(): string
  • set margin(value: string): void
  • Gets or sets control margin

    Returns string

  • Gets or sets control margin

    Parameters

    • value: string

    Returns void

  • get marginInPixels(): number
  • Gets control margin in pixels

    Returns number

  • get maxHeight(): string | number
  • set maxHeight(value: string | number): void
  • Returns string | number

  • Parameters

    • value: string | number

    Returns void

  • get maxHeightInPixels(): number
  • Gets the maximum width allowed by the control in pixels

    Returns number

  • get maxWidth(): string | number
  • set maxWidth(value: string | number): void
  • Gets or sets the maximum width allowed by the control

    Returns string | number

  • Gets or sets the maximum width allowed by the control

    Parameters

    • value: string | number

    Returns void

  • get maxWidthInPixels(): number
  • Gets the maximum width allowed by the control in pixels

    Returns number

  • get notRenderable(): boolean
  • set notRenderable(value: boolean): void
  • Gets or sets a boolean indicating if the control can be rendered

    Returns boolean

  • Gets or sets a boolean indicating if the control can be rendered

    Parameters

    • value: boolean

    Returns void

  • get onFocusSelectAll(): boolean
  • set onFocusSelectAll(value: boolean): void
  • Gets or sets a boolean indicating whether to select complete text by default on input focus

    Returns boolean

  • Gets or sets a boolean indicating whether to select complete text by default on input focus

    Parameters

    • value: boolean

    Returns void

  • get outlineColor(): string
  • set outlineColor(value: string): void
  • Gets or sets outlineColor of the text to display

    Returns string

  • Gets or sets outlineColor of the text to display

    Parameters

    • value: string

    Returns void

  • get outlineWidth(): number
  • set outlineWidth(value: number): void
  • Gets or sets outlineWidth of the text to display

    Returns number

  • Gets or sets outlineWidth of the text to display

    Parameters

    • value: number

    Returns void

  • get paddingBottom(): string | number
  • set paddingBottom(value: string | number): void
  • get paddingBottomInPixels(): number
  • set paddingBottomInPixels(value: number): void
  • get paddingLeft(): string | number
  • set paddingLeft(value: string | number): void
  • get paddingLeftInPixels(): number
  • set paddingLeftInPixels(value: number): void
  • get paddingRight(): string | number
  • set paddingRight(value: string | number): void
  • get paddingRightInPixels(): number
  • set paddingRightInPixels(value: number): void
  • get paddingTop(): string | number
  • set paddingTop(value: string | number): void
  • get paddingTopInPixels(): number
  • set paddingTopInPixels(value: number): void
  • get placeholderColor(): string
  • set placeholderColor(value: string): void
  • Gets or sets the placeholder color

    Returns string

  • Gets or sets the placeholder color

    Parameters

    • value: string

    Returns void

  • get placeholderText(): string
  • set placeholderText(value: string): void
  • Gets or sets the text displayed when the control is empty

    Returns string

  • Gets or sets the text displayed when the control is empty

    Parameters

    • value: string

    Returns void

  • get rotation(): number
  • set rotation(value: number): void
  • get scaleX(): number
  • set scaleX(value: number): void
  • get scaleY(): number
  • set scaleY(value: number): void
  • get shadowBlur(): number
  • set shadowBlur(value: number): void
  • Gets or sets a value indicating the amount of blur to use to render the shadow

    Returns number

  • Gets or sets a value indicating the amount of blur to use to render the shadow

    Parameters

    • value: number

    Returns void

  • get shadowColor(): string
  • set shadowColor(value: string): void
  • Gets or sets a value indicating the color of the shadow (black by default ie. "#000")

    Returns string

  • Gets or sets a value indicating the color of the shadow (black by default ie. "#000")

    Parameters

    • value: string

    Returns void

  • get shadowOffsetX(): number
  • set shadowOffsetX(value: number): void
  • Gets or sets a value indicating the offset to apply on X axis to render the shadow

    Returns number

  • Gets or sets a value indicating the offset to apply on X axis to render the shadow

    Parameters

    • value: number

    Returns void

  • get shadowOffsetY(): number
  • set shadowOffsetY(value: number): void
  • Gets or sets a value indicating the offset to apply on Y axis to render the shadow

    Returns number

  • Gets or sets a value indicating the offset to apply on Y axis to render the shadow

    Parameters

    • value: number

    Returns void

  • get text(): string
  • set text(value: string): void
  • Gets or sets the text displayed in the control

    Returns string

  • Gets or sets the text displayed in the control

    Parameters

    • value: string

    Returns void

  • get textHighlightColor(): string
  • set textHighlightColor(value: string): void
  • Gets or sets the text hightlight color

    Returns string

  • Gets or sets the text hightlight color

    Parameters

    • value: string

    Returns void

  • get thickness(): number
  • set thickness(value: number): void
  • Gets or sets border thickness

    Returns number

  • Gets or sets border thickness

    Parameters

    • value: number

    Returns void

  • get top(): string | number
  • set top(value: string | number): void
  • get topInPixels(): number
  • set topInPixels(value: number): void
  • get transformCenterX(): number
  • set transformCenterX(value: number): void
  • get transformCenterY(): number
  • set transformCenterY(value: number): void
  • Gets the transformed measure, that is the bounding box of the control after applying all transformations

    Returns Measure

  • get typeName(): string
  • Gets the control type name

    Returns string

  • get verticalAlignment(): number
  • set verticalAlignment(value: number): void
  • get width(): string | number
  • set width(value: string | number): void
  • Gets or sets control width

    Returns string | number

  • Gets or sets control width

    Parameters

    • value: string | number

    Returns void

  • get widthInPixels(): number
  • set widthInPixels(value: number): void
  • get zIndex(): number
  • set zIndex(value: number): void
  • Gets or sets z index which is used to reorder controls on the z axis

    Returns number

  • Gets or sets z index which is used to reorder controls on the z axis

    Parameters

    • value: number

    Returns void

  • get HORIZONTAL_ALIGNMENT_CENTER(): number
  • HORIZONTAL_ALIGNMENT_CENTER

    Returns number

  • get HORIZONTAL_ALIGNMENT_LEFT(): number
  • HORIZONTAL_ALIGNMENT_LEFT

    Returns number

  • get HORIZONTAL_ALIGNMENT_RIGHT(): number
  • HORIZONTAL_ALIGNMENT_RIGHT

    Returns number

  • get VERTICAL_ALIGNMENT_BOTTOM(): number
  • VERTICAL_ALIGNMENT_BOTTOM

    Returns number

  • get VERTICAL_ALIGNMENT_CENTER(): number
  • VERTICAL_ALIGNMENT_CENTER

    Returns number

  • get VERTICAL_ALIGNMENT_TOP(): number
  • VERTICAL_ALIGNMENT_TOP

    Returns number

Methods

  • _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void
  • Parameters

    • target: Control
    • coordinates: Vector2
    • pointerId: number
    • buttonIndex: number
    • notifyClick: boolean

    Returns void

  • blur(): void
  • Function to unfocus an inputText programmatically

    Returns void

  • contains(x: number, y: number): boolean
  • Tests if a given coordinates belong to the current control

    Parameters

    • x: number

      defines x coordinate to test

    • y: number

      defines y coordinate to test

    Returns boolean

    true if the coordinates are inside the control

  • dipose(): void
  • Returns void

  • dispose(): void
  • Releases associated resources

    Returns void

  • focus(): void
  • Function to focus an inputText programmatically

    Returns void

  • Gets the first ascendant in the hierarchy of the given type

    Parameters

    • className: string

      defines the required type

    Returns Nullable<Control>

    the ascendant or null if not found

  • getClassName(): string
  • Get the current class name of the control.

    Returns string

    current class name

  • getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[]
  • Will return all controls that have this control as ascendant

    Parameters

    • Optional directDescendantsOnly: boolean

      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

    • Optional predicate: (control: Control) => boolean

      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

    Returns Control[]

    all child controls

  • getDescendantsToRef(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void
  • Will store all controls that have this control as ascendant in a given array

    Parameters

    • results: Control[]

      defines the array where to store the descendants

    • Optional directDescendantsOnly: boolean

      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

    • Optional predicate: (control: Control) => boolean

      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

    Returns void

  • Gets coordinates in local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    Returns Vector2

    the new coordinates in local space

  • Gets coordinates in local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    • result: Vector2

      defines the target vector2 where to store the result

    Returns Control

    the current control

  • Gets coordinates in parent local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    Returns Vector2

    the new coordinates in parent local space

  • isAscendant(container: Control): boolean
  • Determines if a container is an ascendant of the current control

    Parameters

    • container: Control

      defines the container to look for

    Returns boolean

    true if the container is one of the ascendant of the control

  • Function called to get the list of controls that should not steal the focus from this control

    Returns Nullable<Control[]>

    an array of controls

  • markAllAsDirty(): void
  • Mark the element and its children as dirty

    Returns void

  • markAsDirty(force?: boolean): void
  • Mark control element as dirty

    Parameters

    • Optional force: boolean

      force non visible elements to be marked too

    Returns void

  • Move the current control to a vector3 position projected onto the screen.

    Parameters

    • position: Vector3

      defines the target position

    • scene: Scene

      defines the hosting scene

    Returns void

  • serialize(serializationObject: any): void
  • Serializes the current control

    Parameters

    • serializationObject: any

      defined the JSON serialized object

    Returns void

  • setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number): void
  • Shorthand function to set the top, right, bottom, and left padding values on the control.

    see

    https://doc.babylonjs.com/how_to/gui#position-and-size

    Parameters

    • paddingTop: string | number

      The value of the top padding.

    • Optional paddingRight: string | number

      The value of the right padding. If omitted, top is used.

    • Optional paddingBottom: string | number

      The value of the bottom padding. If omitted, top is used.

    • Optional paddingLeft: string | number

      The value of the left padding. If omitted, right is used.

    Returns void

  • setPaddingInPixels(paddingTop: number, paddingRight?: number, paddingBottom?: number, paddingLeft?: number): void
  • Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.

    see

    https://doc.babylonjs.com/how_to/gui#position-and-size

    Parameters

    • paddingTop: number

      The value in pixels of the top padding.

    • Optional paddingRight: number

      The value in pixels of the right padding. If omitted, top is used.

    • Optional paddingBottom: number

      The value in pixels of the bottom padding. If omitted, top is used.

    • Optional paddingLeft: number

      The value in pixels of the left padding. If omitted, right is used.

    Returns void

  • Creates a Control from parsed data

    Parameters

    • serializedObject: any

      defines parsed data

    • host: AdvancedDynamicTexture

      defines the hosting AdvancedDynamicTexture

    Returns Control

    a new Control

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static method

Settings

Theme