Reference API Roblox

Engine API

Website

Related

Reference API Roblox

InputActionLabel

A GuiObject that automatically displays the keybinding for an action as text or an image.

Member index 12

HistoryMember
732FontFace: Font
732ImageColor3: Color3
732ImageTransparency: float
732InputAction: InputAction
732ResolvedImageContent: Content
732ResolvedText: string
732TextColor3: Color3
732TextSize: float
732TextTransparency: float
732TextWrapped: bool
732TextXAlignment: TextXAlignment
732TextYAlignment: TextYAlignment
inherited from GuiObject
553Active: bool
553AnchorPoint: Vector2
553AutomaticSize: AutomaticSize
553BackgroundColor3: Color3
553BackgroundTransparency: float
553BorderColor3: Color3
553BorderMode: BorderMode
553BorderSizePixel: int
553ClipsDescendants: bool
553Draggable: bool
588GuiState: GuiState
737InputSink: InputSink
589Interactable: bool
553LayoutOrder: int
553NextSelectionDown: GuiObject
553NextSelectionLeft: GuiObject
553NextSelectionRight: GuiObject
553NextSelectionUp: GuiObject
553Position: UDim2
553Rotation: float
553Selectable: bool
553SelectionImageObject: GuiObject
553SelectionOrder: int
553Size: UDim2
553SizeConstraint: SizeConstraint
553Visible: bool
553ZIndex: int
462TweenPosition(endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenPositionInternal(endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSize(endSize: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSizeAndPosition(endSize: UDim2, endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenSizeAndPositionInternal(endSize: UDim2, endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
713TweenSizeInternal(endSize: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462DragBegin(initialPosition: UDim2)
462DragStopped(x: int, y: int)
483InputBegan(input: InputObject)
483InputChanged(input: InputObject)
483InputEnded(input: InputObject)
462MouseEnter(x: int, y: int)
462MouseLeave(x: int, y: int)
462MouseMoved(x: int, y: int)
462MouseWheelBackward(x: int, y: int)
462MouseWheelForward(x: int, y: int)
462SelectionGained()
462SelectionLost()
462TouchLongPress(touchPositions: Array, state: UserInputState)
462TouchPan(touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState)
462TouchPinch(touchPositions: Array, scale: float, velocity: float, state: UserInputState)
462TouchRotate(touchPositions: Array, rotation: float, velocity: float, state: UserInputState)
462TouchSwipe(swipeDirection: SwipeDirection, numberOfTouches: int)
462TouchTap(touchPositions: Array)
inherited from GuiBase2d
553AbsolutePosition: Vector2
553AbsoluteRotation: float
553AbsoluteSize: Vector2
553AutoLocalize: bool
553RootLocalizationTable: LocalizationTable
553SelectionBehaviorDown: SelectionBehavior
553SelectionBehaviorLeft: SelectionBehavior
553SelectionBehaviorRight: SelectionBehavior
553SelectionBehaviorUp: SelectionBehavior
553SelectionGroup: bool
525SelectionChanged(amISelected: bool, previousSelection: GuiObject, newSelection: GuiObject)
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
723IsInSandbox: bool
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

InputActionLabel is a drag-and-drop GuiObject that automatically shows the appropriate key or icon for an InputAction based on the player's current input device (keyboard/mouse, gamepad, touch, VR). When the player switches devices or the binding is rebound, the label updates instantly without scripting.

Rendering of the InputActionLabel depends on the InputAction (linked through InputActionLabel.InputAction) and that action's child InputBindings. As the label resolves what to show, it follows this order:

  1. Custom Images — If child InputBindings have their DisplayImage property set, the label renders those images directly, optionally modified by ImageColor3 and ImageTransparency.

  2. Platform Key Images — Lacking custom images, the label renders platform-provided images for child InputBindings through UserInputService:GetImageForKeyCode(), if such images are available. Composite bindings with modifiers show multiple icons with + separators.

  3. Custom Names — Lacking available images, if child InputBindings have their DisplayName property set, the label renders that text in a style defined by FontFace, TextColor3, TextSize, TextTransparency, TextWrapped, TextXAlignment, and TextYAlignment.

  4. Platform Key Strings — Lacking all of the above, the label renders platform-provided strings through UserInputService:GetStringForKeyCode().

  5. If no InputAction is assigned or no child InputBinding exists, the label renders a placeholder icon.

History 13

Members 12

FontFace

TypeDefault
Font

This property is similar to TextLabel.FontFace and determines the font family, weight, and style used when the label renders in a text mode.

History 1

ImageColor3

TypeDefault
Color31, 1, 1

This property determines how label images are colorized. When set to white, no colorization occurs. This property is useful for reusing image assets; if the source images are completely white with transparency, you can set the entire label color at once with this property.

History 1

ImageTransparency

TypeDefault
float0

This property determines the alpha of rendered label images. A value of 0 is completely opaque and a value of 1 is completely transparent (invisible).

History 1

InputAction

TypeDefault
InputAction

The InputAction instance for which to have the label automatically resolve and display its preferred binding. When the binding changes (due to rebinding or input device switching), the label updates automatically.

Setting this to nil clears the display and shows the placeholder.

History 1

ResolvedImageContent

TypeDefault
Content

Contains the Content of the first resolved image when the label renders in an image mode. Empty when in text or placeholder mode. This is a read-only property set by the engine when the binding resolves.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

ResolvedText

TypeDefault
string

Contains the composed key name string such as Ctrl + Shift + Space when the label renders in text mode. Empty when the label renders in image or placeholder mode. This is a read-only property set by the engine when the binding resolves.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

TextColor3

TypeDefault
Color30.105882, 0.164706, 0.207843

This property determines the color of all text rendered by the label.

History 1

TextSize

TypeDefault
float8

Controls the font size in pixels for text mode rendering. Value is clamped between 1 and 200.

History 1

TextTransparency

TypeDefault
float0

This property determines the transparency of all text rendered by the label.

History 1

TextWrapped

TypeDefault
boolfalse

When true, text renders on multiple lines within the label's space so that TextSize lines never exceed the GuiBase2d.AbsoluteSize of the object. This is achieved by breaking long lines of text into multiple lines.

History 1

TextXAlignment

TypeDefault
TextXAlignmentCenter

This property determines the horizontal alignment of text rendered within the label's space.

History 1

TextYAlignment

TypeDefault
TextYAlignmentCenter

This property determines the vertical alignment of text rendered within the label's space.

History 1

Settings