This module lets you create ImageLabels/ImageButtons that update images based on what controller they’re using!
This module can also be used to get controller icons, either from a specific controller type or just the current controller type.
Get Module Here
| Download the Controller Icons
The Controller Icons used were created by Xelu
Set Up the Module
Setting up the module is easy! Just insert the module in for example ReplicatedStorage
, then just require it in a LocalScript
!
local ReplicatedStorage = game:GetService("ReplicatedStorage")
require(ReplicatedStorage.ConsoleIcons) -- or just replace it with the path of the module
Use the Module
To make use of this module, simply
- Create an
ImageLabel
/ImageButton
(or use an existing one) - Add the
GUI_ConsolePrompt
tag to the image - Use these attributes to customize the image:
-
ConsoleButton
- sets the controller icon (check Docs for more info) -
CustomConsoleType
- sets the console icon to a specific set of controller icons (check Docs for more info) -
HideWhenGamepadDisconnects
- if true, the Image will only show if a controller is connected.
Docs
Attributes
-
ConsoleButton
, sets the controller icon
NOTE: The icon names are the same as they are inEnum.KeyCode
This attribute is REQUIRED -
CustomConsoleType
, sets the console icon to a specific set of controller icons
Accepted Values:ps
,xbox
This attribute is NOT REQUIRED, if not included, it will set the controller icons based off of which controller the player is using. -
HideWhenGamepadDisconnects
, if true, the Image will only show if a gamepad is connected.
This attribute is NOT REQUIRED, if not included, the Image will not disappear if there is no controller.
Functions
-
ConsoleIcons.GetConsoleIcon(keyCodeName : string, customConsoleType : string)
This function gets the asset id for a specific console icon
IfcustomConsoleType
is left as nil, the icon returned will be based on which controller the player is using. -
ConsoleIcons.RegisterImage(img : ImageLabel | ImageButton)
This function registers a specific ImageLabel to be updated by the module
If you find any bugs, pls tell me
Is this resource useful to you?
- Very useful
- I’d probably use it
- Not useful at all (if you picked this pls tell me why)
0 voters