Class InputText
Hierarchy (View Summary)
- Control
- InputText
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a new InputText
Parameters
Optionalname: stringdefines the control name
- text: string = ""
defines the text of the control
Returns InputText
Properties
animations
Array of animations
disable Mobile Prompt
Force disable prompt on mobile device
hover Cursor
Gets or sets the cursor to use when the control is hovered
is Focus Invisible
Gets or sets a boolean indicating if the control can be focusable
is Hit Test Visible
Gets or sets a boolean indicating if the control can be hit with pointer events
is Pointer Blocker
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
is Serializable
Indicates if the control should be serialized. Defaults to true.
metadata
Gets or sets an object used to store user defined information for the node
Optionalname
defines the control name
on Accessibility Tag Changed Observable
Observable that fires whenever the accessibility event of the control has changed
on After Draw Observable
An event triggered after the control was drawn
on Before Draw Observable
An event triggered before drawing the control
on Before Key Add Observable
Observable raised just before an entered character is to be added
on Blur Observable
Observable raised when the control loses the focus
on Dirty Observable
An event triggered when the control is marked as dirty
on Dispose Observable
An event triggered when the control has been disposed
on Enabled State Changed Observable
Observable that fires when the control's enabled state changes
on Enter Pressed Observable
An event triggered when a control receives an ENTER key down event
on Focus Observable
Observable raised when the control gets the focus
on Is Visible Changed Observable
An event triggered when the control isVisible is changed
on Keyboard Event Processed Observable
Observable raised when a key event was processed
on Pointer Click Observable
An event triggered when a control is clicked on
on Pointer Down Observable
An event triggered when the pointer taps the control
on Pointer Enter Observable
An event triggered when pointer enters the control
on Pointer Move Observable
An event triggered when the pointer moves over the control.
on Pointer Out Observable
An event triggered when the pointer moves out of the control.
on Pointer Up Observable
An event triggered when pointer up
on Text Changed Observable
Observable raised when the text changes
on Text Copy Observable
Observable raised when copy event is triggered
on Text Cut Observable
Observable raised when cut event is triggered
on Text Highlight Observable
Observable raised when the text is highlighted
on Text Paste Observable
Observable raised when paste event is triggered
on Wheel Observable
An event triggered when pointer wheel is scrolled
Optionaloverlap Delta Multiplier
Gets/sets the deoverlap movement multiplier
Optionaloverlap Group
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.
parent
Gets or sets the control parent
prompt Message
Gets or sets a string representing the message displayed on mobile when the control gets the focus
tab Index
The tab index of this control. -1 indicates this control is not part of the tab navigation. A positive value indicates the order of the control in the tab navigation. A value of 0 indicated the control will be focused after all controls with a positive index. More than one control can have the same tab index and the navigation would then go through all controls with the same value in an order defined by the layout or the hierarchy. The value can be changed at any time.
unique Id
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
use Bitmap Cache
Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)
StaticAdd Header
control: Control,
text: string,
size: string | number,
options: { controlFirst: boolean; isHorizontal: boolean },
) => any = ...
StaticAllow Alpha Inheritance
Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
Accessors
accessibility Tag
-
get accessibilityTag(): Nullable<IAccessibilityTag>
Returns Nullable<IAccessibilityTag>
-
set accessibilityTag(value: Nullable<IAccessibilityTag>): void
Gets or sets the accessibility tag to describe the control for accessibility purpose. By default, GUI controls already indicate accessibility info, but one can override the info using this tag.
Parameters
- value: Nullable<IAccessibilityTag>
Returns void
add Key
-
get addKey(): boolean
Gets or sets if the current key should be added
Returns boolean
-
set addKey(flag: boolean): void
Parameters
- flag: boolean
Returns void
alpha
-
get alpha(): number
Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)
Returns number
-
set alpha(value: number): void
Parameters
- value: number
Returns void
auto Stretch Width
-
get autoStretchWidth(): boolean
Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text
Returns boolean
-
set autoStretchWidth(value: boolean): void
Parameters
- value: boolean
Returns void
background
-
get background(): string
Gets or sets the background color
Returns string
-
set background(value: string): void
Parameters
- value: string
Returns void
center X
-
get centerX(): number
Gets the center coordinate on X axis
Returns number
center Y
-
get centerY(): number
Gets the center coordinate on Y axis
Returns number
clip Children
-
get clipChildren(): boolean
Returns boolean
-
set clipChildren(value: boolean): void
Sets/Gets 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
Parameters
- value: boolean
Returns void
clip Content
-
get clipContent(): boolean
Returns boolean
-
set clipContent(value: boolean): void
Sets/Gets a boolean indicating that control content must be clipped Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
Parameters
- value: boolean
Returns void
color
-
get color(): string
Gets or sets foreground color
Returns string
-
set color(value: string): void
Parameters
- value: string
Returns void
current Key
-
get currentKey(): string
Gets or sets the value of the current key being entered
Returns string
-
set currentKey(key: string): void
Parameters
- key: string
Returns void
dead Key
-
get deadKey(): boolean
Gets or sets the dead key. 0 to disable.
Returns boolean
-
set deadKey(flag: boolean): void
Parameters
- flag: boolean
Returns void
descendants Only Padding
-
get descendantsOnlyPadding(): 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.
Returns boolean
-
set descendantsOnlyPadding(value: boolean): void
Parameters
- value: boolean
Returns void
disabled Color
-
get disabledColor(): string
Gets or sets background color of control if it's disabled. Only applies to Button class.
Returns string
-
set disabledColor(value: string): void
Parameters
- value: string
Returns void
disabled Color Item
-
get disabledColorItem(): string
Gets or sets front color of control if it's disabled. Only applies to Checkbox class.
Returns string
-
set disabledColorItem(value: string): void
Parameters
- value: string
Returns void
fixed Ratio
-
get 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
Returns number
-
set fixedRatio(value: number): void
Parameters
- value: number
Returns void
fixed Ratio Master Is Width
-
get fixedRatioMasterIsWidth(): boolean
Gets or sets a boolean indicating that the fixed ratio is set on the width instead of the height. True by default. When the height of a control is set, this property is changed to false.
Returns boolean
-
set fixedRatioMasterIsWidth(value: boolean): void
Parameters
- value: boolean
Returns void
flex Grow
-
get flexGrow(): number
Gets or sets the nonnegative share of free main-axis space in a FlexPanel.
Returns number
-
set flexGrow(value: number): void
Parameters
- value: number
Returns void
flex Shrink
-
get flexShrink(): number
Gets or sets the nonnegative shrink factor in a FlexPanel, weighted by the declared main-axis size.
Returns number
-
set flexShrink(value: number): void
Parameters
- value: number
Returns void
focused Background
-
get focusedBackground(): string
Gets or sets the background color when focused
Returns string
-
set focusedBackground(value: string): void
Parameters
- value: string
Returns void
focused Color
-
set focusedColor(value: string): void
Gets or sets the background color when focused
Parameters
- value: string
Returns void
font Family
-
get fontFamily(): string
Gets or set font family
Returns string
-
set fontFamily(value: string): void
Parameters
- value: string
Returns void
font Offset
-
get fontOffset(): { ascent: number; descent: number; height: number }
Gets or set information about font offsets (used to render and align text)
Returns { ascent: number; descent: number; height: number }
-
set fontOffset(
offset: { ascent: number; descent: number; height: number },
): voidParameters
- offset: { ascent: number; descent: number; height: number }
Returns void
font Size
-
get fontSize(): string | number
Gets or sets the font size in px, percent of parent height, em, or rem. For font declarations, em uses the parent font and rem uses the GUI root font. Relative font sizes on the root use the default 18px font, including adaptive scaling.
Returns string | number
-
set fontSize(value: string | number): void
Parameters
- value: string | number
Returns void
font Size In Pixels
-
get fontSizeInPixels(): number
Gets or sets font size in pixels
Returns number
-
set fontSizeInPixels(value: number): void
Parameters
- value: number
Returns void
font Style
-
get fontStyle(): string
Gets or sets font style
Returns string
-
set fontStyle(value: string): void
Parameters
- value: string
Returns void
font Weight
-
get fontWeight(): string
Gets or sets font weight
Returns string
-
set fontWeight(value: string): void
Parameters
- value: string
Returns void
gradient
-
Gets or sets gradient. Setting a gradient will override the color
Returns Nullable<BaseGradient>
-
Parameters
- value: Nullable<BaseGradient>
Returns void
height
-
get height(): string | number
Gets or sets control height
Returns string | number
-
set height(value: string | number): void
Parameters
- value: string | number
Returns void
height In Pixels
-
get heightInPixels(): number
Gets or sets control height in pixel
Returns number
-
set heightInPixels(value: number): void
Parameters
- value: number
Returns void
highligher Opacity
-
get highligherOpacity(): number
-
set highligherOpacity(value: number): void
Parameters
- value: number
Returns void
highlight Color
-
get highlightColor(): string
Gets or sets a string defining the color to use for highlighting this control
Returns string
-
set highlightColor(value: string): void
Parameters
- value: string
Returns void
highlighted Text
-
get highlightedText(): string
Gets or sets the highlight text
Returns string
-
set highlightedText(text: string): void
Parameters
- text: string
Returns void
highlighter Opacity
-
get highlighterOpacity(): number
Gets or sets the text highlighter transparency; default: 0.4
Returns number
-
set highlighterOpacity(value: number): void
Parameters
- value: number
Returns void
highlight Line Width
-
get highlightLineWidth(): number
Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
Returns number
-
set highlightLineWidth(value: number): void
Parameters
- value: number
Returns void
horizontal Alignment
-
get horizontalAlignment(): number
Gets or sets the horizontal alignment
Returns number
-
set horizontalAlignment(value: number): void
Parameters
- value: number
Returns void
host
-
Get the hosting AdvancedDynamicTexture
Returns AdvancedDynamicTexture
is Dirty
-
get isDirty(): boolean
Gets a boolean indicating that the control needs to update its rendering
Returns boolean
is Enabled
-
get isEnabled(): boolean
Gets or sets if control is Enabled
Returns boolean
-
set isEnabled(value: boolean): void
Parameters
- value: boolean
Returns void
is Highlighted
-
get isHighlighted(): boolean
Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
Returns boolean
-
set isHighlighted(value: boolean): void
Parameters
- value: boolean
Returns void
is Read Only
-
get isReadOnly(): 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
Returns boolean
-
set isReadOnly(value: boolean): void
Parameters
- value: boolean
Returns void
is Visible
-
get isVisible(): boolean
Gets or sets a boolean indicating if the control is visible
Returns boolean
-
set isVisible(value: boolean): void
Parameters
- value: boolean
Returns void
left
-
get left(): string | number
Gets or sets a value indicating the left coordinate of the control
Returns string | number
-
set left(value: string | number): void
Parameters
- value: string | number
Returns void
left In Pixels
-
get leftInPixels(): number
Gets or sets a value indicating the left coordinate in pixels of the control
Returns number
-
set leftInPixels(value: number): void
Parameters
- value: number
Returns void
linked Mesh
-
get linkedMesh(): Nullable<TransformNode>
Gets the current linked mesh (or null if none)
Returns Nullable<TransformNode>
link Offset X
-
get linkOffsetX(): string | number
Gets or sets a value indicating the offset on X axis to the linked mesh
Returns string | number
-
set linkOffsetX(value: string | number): void
Parameters
- value: string | number
Returns void
link Offset X In Pixels
-
get linkOffsetXInPixels(): number
Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
Returns number
-
set linkOffsetXInPixels(value: number): void
Parameters
- value: number
Returns void
link Offset Y
-
get linkOffsetY(): string | number
Gets or sets a value indicating the offset on Y axis to the linked mesh
Returns string | number
-
set linkOffsetY(value: string | number): void
Parameters
- value: string | number
Returns void
link Offset Y In Pixels
-
get linkOffsetYInPixels(): number
Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
Returns number
-
set linkOffsetYInPixels(value: number): void
Parameters
- value: number
Returns void
margin
-
get margin(): string
Gets or sets control margin
Returns string
-
set margin(value: string): void
Parameters
- value: string
Returns void
margin In Pixels
-
get marginInPixels(): number
Gets control margin in pixels
Returns number
max Width
-
get maxWidth(): string | number
Gets or sets the maximum width allowed by the control
Returns string | number
-
set maxWidth(value: string | number): void
Parameters
- value: string | number
Returns void
max Width In Pixels
-
get maxWidthInPixels(): number
Gets the maximum width allowed by the control in pixels
Returns number
not Renderable
-
get notRenderable(): boolean
Gets or sets a boolean indicating if the control can be rendered
Returns boolean
-
set notRenderable(value: boolean): void
Parameters
- value: boolean
Returns void
on Focus Select All
-
get onFocusSelectAll(): boolean
Gets or sets a boolean indicating whether to select complete text by default on input focus
Returns boolean
-
set onFocusSelectAll(value: boolean): void
Parameters
- value: boolean
Returns void
outline Color
-
get outlineColor(): string
Gets or sets outlineColor of the text to display
Returns string
-
set outlineColor(value: string): void
Parameters
- value: string
Returns void
outline Width
-
get outlineWidth(): number
Gets or sets outlineWidth of the text to display
Returns number
-
set outlineWidth(value: number): void
Parameters
- value: number
Returns void
padding Bottom
-
get paddingBottom(): string | number
Gets or sets a value indicating the padding to use on the bottom of the control
Returns string | number
-
set paddingBottom(value: string | number): void
Parameters
- value: string | number
Returns void
padding Bottom In Pixels
-
get paddingBottomInPixels(): number
Gets or sets a value indicating the padding in pixels to use on the bottom of the control
Returns number
-
set paddingBottomInPixels(value: number): void
Parameters
- value: number
Returns void
padding Left
-
get paddingLeft(): string | number
Gets or sets a value indicating the padding to use on the left of the control
Returns string | number
-
set paddingLeft(value: string | number): void
Parameters
- value: string | number
Returns void
padding Left In Pixels
-
get paddingLeftInPixels(): number
Gets or sets a value indicating the padding in pixels to use on the left of the control
Returns number
-
set paddingLeftInPixels(value: number): void
Parameters
- value: number
Returns void
padding Right
-
get paddingRight(): string | number
Gets or sets a value indicating the padding to use on the right of the control
Returns string | number
-
set paddingRight(value: string | number): void
Parameters
- value: string | number
Returns void
padding Right In Pixels
-
get paddingRightInPixels(): number
Gets or sets a value indicating the padding in pixels to use on the right of the control
Returns number
-
set paddingRightInPixels(value: number): void
Parameters
- value: number
Returns void
padding Top
-
get paddingTop(): string | number
Gets or sets a value indicating the padding to use on the top of the control
Returns string | number
-
set paddingTop(value: string | number): void
Parameters
- value: string | number
Returns void
padding Top In Pixels
-
get paddingTopInPixels(): number
Gets or sets a value indicating the padding in pixels to use on the top of the control
Returns number
-
set paddingTopInPixels(value: number): void
Parameters
- value: number
Returns void
placeholder Color
-
get placeholderColor(): string
Gets or sets the placeholder color
Returns string
-
set placeholderColor(value: string): void
Parameters
- value: string
Returns void
placeholder Text
-
get placeholderText(): string
Gets or sets the text displayed when the control is empty
Returns string
-
set placeholderText(value: string): void
Parameters
- value: string
Returns void
rotation
-
get rotation(): number
Gets or sets the rotation angle (0 by default)
Returns number
-
set rotation(value: number): void
Parameters
- value: number
Returns void
scale X
-
get scaleX(): number
Gets or sets a value indicating the scale factor on X axis (1 by default)
Returns number
-
set scaleX(value: number): void
Parameters
- value: number
Returns void
scale Y
-
get scaleY(): number
Gets or sets a value indicating the scale factor on Y axis (1 by default)
Returns number
-
set scaleY(value: number): void
Parameters
- value: number
Returns void
shadow Blur
-
get shadowBlur(): number
Gets or sets a value indicating the amount of blur to use to render the shadow
Returns number
-
set shadowBlur(value: number): void
Parameters
- value: number
Returns void
shadow Color
-
get shadowColor(): string
Gets or sets a value indicating the color of the shadow (black by default ie. "#000")
Returns string
-
set shadowColor(value: string): void
Parameters
- value: string
Returns void
shadow Offset X
-
get shadowOffsetX(): number
Gets or sets a value indicating the offset in pixels to apply on X axis to render the shadow
Returns number
-
set shadowOffsetX(value: number): void
Parameters
- value: number
Returns void
shadow Offset Y
-
get shadowOffsetY(): number
Gets or sets a value indicating the offset in pixels to apply on Y axis to render the shadow
Returns number
-
set shadowOffsetY(value: number): void
Parameters
- value: number
Returns void
style
text
-
get text(): string
Gets or sets the text displayed in the control
Returns string
-
set text(value: string): void
Parameters
- value: string
Returns void
text Highlight Color
-
get textHighlightColor(): string
Gets or sets the text hightlight color
Returns string
-
set textHighlightColor(value: string): void
Parameters
- value: string
Returns void
thickness
-
get thickness(): number
Gets or sets border thickness
Returns number
-
set thickness(value: number): void
Parameters
- value: number
Returns void
top
-
get top(): string | number
Gets or sets a value indicating the top coordinate of the control
Returns string | number
-
set top(value: string | number): void
Parameters
- value: string | number
Returns void
top In Pixels
-
get topInPixels(): number
Gets or sets a value indicating the top coordinate in pixels of the control
Returns number
-
set topInPixels(value: number): void
Parameters
- value: number
Returns void
transform Center X
-
get transformCenterX(): number
Gets or sets the transformation center on X axis (0 by default)
Returns number
-
set transformCenterX(value: number): void
Parameters
- value: number
Returns void
transform Center Y
-
get transformCenterY(): number
Gets or sets the transformation center on Y axis (0 by default)
Returns number
-
set transformCenterY(value: number): void
Parameters
- value: number
Returns void
transformed Measure
-
Gets the transformed measure, that is the bounding box of the control after applying all transformations
Returns Measure
type Name
-
get typeName(): string
Gets the control type name
Returns string
vertical Alignment
-
get verticalAlignment(): number
Gets or sets the vertical alignment
Returns number
-
set verticalAlignment(value: number): void
Parameters
- value: number
Returns void
width
-
get width(): string | number
Gets or sets control width
Returns string | number
-
set width(value: string | number): void
Gets or sets control width
Parameters
- value: string | number
Returns void
width In Pixels
-
get widthInPixels(): number
Gets or sets the control width in pixel
Returns number
-
set widthInPixels(value: number): void
Parameters
- value: number
Returns void
z Index
-
get zIndex(): number
Gets or sets z index which is used to reorder controls on the z axis
Returns number
-
set zIndex(value: number): void
Parameters
- value: number
Returns void
StaticHORIZONTAL_ ALIGNMENT_ CENTER
-
get HORIZONTAL_ALIGNMENT_CENTER(): number
HORIZONTAL_ALIGNMENT_CENTER
Returns number
StaticHORIZONTAL_ ALIGNMENT_ LEFT
-
get HORIZONTAL_ALIGNMENT_LEFT(): number
HORIZONTAL_ALIGNMENT_LEFT
Returns number
StaticHORIZONTAL_ ALIGNMENT_ RIGHT
-
get HORIZONTAL_ALIGNMENT_RIGHT(): number
HORIZONTAL_ALIGNMENT_RIGHT
Returns number
StaticVERTICAL_ ALIGNMENT_ BOTTOM
-
get VERTICAL_ALIGNMENT_BOTTOM(): number
VERTICAL_ALIGNMENT_BOTTOM
Returns number
StaticVERTICAL_ ALIGNMENT_ CENTER
-
get VERTICAL_ALIGNMENT_CENTER(): number
VERTICAL_ALIGNMENT_CENTER
Returns number
StaticVERTICAL_ ALIGNMENT_ TOP
-
get VERTICAL_ALIGNMENT_TOP(): number
VERTICAL_ALIGNMENT_TOP
Returns number
Methods
_ on Pointer Pick
-
_onPointerPick(
target: Control,
coordinates: Vector2,
pointerId: number,
buttonIndex: number,
notifyClick: boolean,
pi: Nullable<PointerInfoBase>,
): booleanParameters
- target: Control
- coordinates: Vector2
- pointerId: number
- buttonIndex: number
- notifyClick: boolean
- pi: Nullable<PointerInfoBase>
Returns boolean
blur
-
Function to unfocus a button programmatically
Returns void
clone
-
Clones a control and its descendants
Parameters
Optionalhost: AdvancedDynamicTexturethe texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
Returns Control
the cloned control
contains
-
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
- x: number
dispose
-
Releases associated resources
Returns void
focus
-
Function to focus a button programmatically
Returns void
get Ascendant Of Class
-
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
- className: string
get Class Name
-
Get the current class name of the control.
Returns string
current class name
get Descendants
-
getDescendants(
directDescendantsOnly?: boolean,
predicate?: (control: Control) => boolean,
): Control[]Will return all controls that have this control as ascendant
Parameters
OptionaldirectDescendantsOnly: booleandefines 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
Optionalpredicate: (control: Control) => booleandefines 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
get Descendants To Ref
-
getDescendantsToRef(
results: Control[],
directDescendantsOnly?: boolean,
predicate?: (control: Control) => boolean,
): voidWill store all controls that have this control as ascendant in a given array
Parameters
- results: Control[]
defines the array where to store the descendants
- directDescendantsOnly: boolean = false
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
Optionalpredicate: (control: Control) => booleandefines 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
- results: Control[]
get Dimension
-
Gets the dimension of the control along a specified axis
Parameters
- dim: "width" | "height"
the dimension to retrieve (width or height)
Returns ValueAndUnit
the dimension value along the specified axis
- dim: "width" | "height"
get Local Coordinates
-
Gets coordinates in local control space
Parameters
- globalCoordinates: Vector2
defines the coordinates to transform
Returns Vector2
the new coordinates in local space
- globalCoordinates: Vector2
get Local Coordinates To Ref
-
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
- globalCoordinates: Vector2
get Parent Local Coordinates
-
Gets coordinates in parent local control space
Parameters
- globalCoordinates: Vector2
defines the coordinates to transform
Returns Vector2
the new coordinates in parent local space
- globalCoordinates: Vector2
is Ascendant
-
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
- container: Control
is Dimension Fully Defined
-
A control has a dimension fully defined if that dimension doesn't depend on the parent's dimension. As an example, a control that has dimensions in pixels is fully defined, while in percentage is not fully defined.
Parameters
- dim: "width" | "height"
the dimension to check (width or height)
Returns boolean
if the dimension is fully defined
- dim: "width" | "height"
is Ready
-
Returns true if the control is ready to be used
Returns boolean
keeps Focus With
-
Function called to get the list of controls that should not steal the focus from this control
Returns Nullable<Control[]>
an array of controls
link With Mesh
-
Link current control with a target mesh
Parameters
- mesh: Nullable<TransformNode>
defines the mesh to link with
Returns void
- mesh: Nullable<TransformNode>
mark All As Dirty
-
Mark the element and its children as dirty
Returns void
mark As Dirty
-
Mark control element as dirty
Parameters
- force: boolean = false
force non visible elements to be marked too
Returns void
- force: boolean = false
move To Vector3
-
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
- position: Vector3
parse
-
parse(
serializedObject: any,
host?: AdvancedDynamicTexture,
urlRewriter?: (url: string) => string,
): ControlParses a serialized object into this control
Parameters
- serializedObject: any
the object with the serialized properties
Optionalhost: AdvancedDynamicTexturethe texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture
OptionalurlRewriter: (url: string) => stringdefines an url rewriter to update urls before sending them to the controls
Returns Control
this control
- serializedObject: any
process Keyboard
-
Handles the keyboard event
Parameters
- evt: IKeyboardEvent
Defines the KeyboardEvent
Returns void
- evt: IKeyboardEvent
select All Text
-
Allow the user to select all text
Returns void
serialize
-
Serializes the current control
Parameters
- serializationObject: any
defined the JSON serialized object
- force: boolean = false
if the control should be serialized even if the isSerializable flag is set to false (default false)
- allowCanvas: boolean = true
defines if the control is allowed to use a Canvas2D object to serialize (true by default)
Returns void
- serializationObject: any
set Padding
-
setPadding(
paddingTop: string | number,
paddingRight?: string | number,
paddingBottom?: string | number,
paddingLeft?: string | number,
): voidShorthand function to set the top, right, bottom, and left padding values on the control.
Parameters
- paddingTop: string | number
The value of the top padding.
OptionalpaddingRight: string | numberThe value of the right padding. If omitted, top is used.
OptionalpaddingBottom: string | numberThe value of the bottom padding. If omitted, top is used.
OptionalpaddingLeft: string | numberThe value of the left padding. If omitted, right is used.
Returns void
- paddingTop: string | number
set Padding In Pixels
-
setPaddingInPixels(
paddingTop: number,
paddingRight?: number,
paddingBottom?: number,
paddingLeft?: number,
): voidShorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
Parameters
- paddingTop: number
The value in pixels of the top padding.
OptionalpaddingRight: numberThe value in pixels of the right padding. If omitted, top is used.
OptionalpaddingBottom: numberThe value in pixels of the bottom padding. If omitted, top is used.
OptionalpaddingLeft: numberThe value in pixels of the left padding. If omitted, right is used.
Returns void
- paddingTop: number
StaticParse
-
Parse(
serializedObject: any,
host: AdvancedDynamicTexture,
urlRewriter?: (url: string) => string,
): ControlCreates a Control from parsed data
Parameters
- serializedObject: any
defines parsed data
- host: AdvancedDynamicTexture
defines the hosting AdvancedDynamicTexture
OptionalurlRewriter: (url: string) => stringdefines an url rewriter to update urls before sending them to the controls
Returns Control
a new Control
- serializedObject: any
Class used to create input text control