Skip to content

Class · inherits GuiObject

InputActionLabel

Official docs ↗

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

About InputActionLabel

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.

Properties 12

  • FontFace: Datatype.FontDetermines the font used to render text.

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

  • ImageColor3: Color3Determines how rendered label images will be colorized.

    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.

  • ImageTransparency: floatDetermines the transparency of rendered label images.

    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).

  • InputAction: InputActionThe InputAction whose preferred binding this label displays.

    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.

  • ResolvedImageContent: ContentReadOnlyNotReplicatedRead-only. The resolved image content currently being displayed.

    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.

  • ResolvedText: stringReadOnlyNotReplicatedThe resolved key name string currently being displayed.

    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.

  • TextColor3: Color3Determines the color of rendered text.

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

  • TextSize: floatDetermines the line height of text in offsets.

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

  • TextTransparency: floatDetermines the transparency of rendered text.

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

  • TextWrapped: booleanDetermines if text wraps to multiple lines within the label's space.

    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.

  • TextXAlignment: TextXAlignmentDetermines the horizontal alignment of rendered text.

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

  • TextYAlignment: TextYAlignmentDetermines the vertical alignment of rendered text.

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

InputActionLabel also has every member of GuiObject. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.