Class · inherits GuiObject
InputActionLabel
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:
Custom Images — If child
InputBindingshave theirDisplayImageproperty set, the label renders those images directly, optionally modified byImageColor3andImageTransparency.Platform Key Images — Lacking custom images, the label renders platform-provided images for child
InputBindingsthroughUserInputService.GetImageForKeyCode, if such images are available. Composite bindings with modifiers show multiple icons with+separators.Custom Names — Lacking available images, if child
InputBindingshave theirDisplayNameproperty set, the label renders that text in a style defined byFontFace,TextColor3,TextSize,TextTransparency,TextWrapped,TextXAlignment, andTextYAlignment.Platform Key Strings — Lacking all of the above, the label renders platform-provided strings through
UserInputService.GetStringForKeyCode.If no
InputActionis assigned or no childInputBindingexists, the label renders a placeholder icon.
Properties 12
FontFace
: Datatype.FontDetermines the font used to render text.This property is similar to
TextLabel.FontFaceand 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
0is completely opaque and a value of1is completely transparent (invisible).InputAction
: InputActionTheInputActionwhose preferred binding this label displays.The
InputActioninstance 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
nilclears the display and shows the placeholder.ResolvedImageContent
: ContentReadOnlyNotReplicatedRead-only. The resolved image content currently being displayed.Contains the
Contentof 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 + Spacewhen 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
1and200.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 thatTextSizelines never exceed theGuiBase2d.AbsoluteSizeof 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.