InputActionLabel
A GuiObject that automatically displays the keybinding for an action as text or an image.
| Memory category | Gui |
|---|
Member index 12
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:
Custom Images — If child InputBindings have their DisplayImage property set, the label renders those images directly, optionally modified by ImageColor3 and ImageTransparency.
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.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.
Platform Key Strings — Lacking all of the above, the label renders platform-provided strings through UserInputService:GetStringForKeyCode().
If no InputAction is assigned or no child InputBinding exists, the label renders a placeholder icon.
History 13
- 732 Add TextYAlignment
- 732 Add TextXAlignment
- 732 Add TextWrapped
- 732 Add TextTransparency
- 732 Add TextSize
- 732 Add TextColor3
- 732 Add ResolvedText
- 732 Add ResolvedImageContent
- 732 Add InputAction
- 732 Add ImageTransparency
- 732 Add ImageColor3
- 732 Add FontFace
- 732 Add InputActionLabel
Members 12
FontFace
| Type | Default | |
|---|---|---|
| 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.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
ImageColor3
| Type | Default | |
|---|---|---|
| Color3 | 1, 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.
| Thread safety | ReadSafe |
|---|---|
| Category | Image |
| Loaded/Saved | true |
History 1
- 732 Add ImageColor3
ImageTransparency
| Type | Default | |
|---|---|---|
| float | 0 | |
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).
| Thread safety | ReadSafe |
|---|---|
| Category | Image |
| Loaded/Saved | true |
History 1
- 732 Add ImageTransparency
InputAction
| Type | Default | |
|---|---|---|
| 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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
History 1
- 732 Add InputAction
ResolvedImageContent
| Type | Default | |
|---|---|---|
| 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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 1
ResolvedText
| Type | Default | |
|---|---|---|
| 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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 1
- 732 Add ResolvedText
TextColor3
| Type | Default | |
|---|---|---|
| Color3 | 0.105882, 0.164706, 0.207843 | |
This property determines the color of all text rendered by the label.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 732 Add TextColor3
TextSize
| Type | Default | |
|---|---|---|
| float | 8 | |
Controls the font size in pixels for text mode rendering. Value is clamped
between 1 and 200.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
TextTransparency
| Type | Default | |
|---|---|---|
| float | 0 | |
This property determines the transparency of all text rendered by the label.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 732 Add TextTransparency
TextWrapped
| Type | Default | |
|---|---|---|
| bool | false | |
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.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 732 Add TextWrapped
TextXAlignment
| Type | Default | |
|---|---|---|
| TextXAlignment | Center | |
This property determines the horizontal alignment of text rendered within the label's space.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 732 Add TextXAlignment
TextYAlignment
| Type | Default | |
|---|---|---|
| TextYAlignment | Center | |
This property determines the vertical alignment of text rendered within the label's space.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 732 Add TextYAlignment