Using ProIcons in Roblox
ProIcons can easily be used in Roblox. All icons have been uploaded to Roblox and have gone through alpha bleeding via Pixelfix.
Basics
A file with the image IDs of all icons is available at icons/roblox.json in the repository. This can be fetched and loaded in a Roblox script using Roblox's HttpService.
local HttpService = game:GetService('HttpService')
local iconsUrl = 'https://github.com/ProCode-Software/proicons/blob/main/icons/roblox.json'
-- Fetch JSON data and catch any errors
local success, data = pcall(function()
return HttpService:JSONDecode(HttpService:GetAsync(iconsUrl))
end)
if success then
print(data)
end
Important
For this script to work, you must enable HTTP requests in your game. You can do so by running the following code in the Command Bar in Roblox Studio:
game:GetService("HttpService").HttpEnabled = true
Roblox documentation:
Format
The file is in the following format:
{
"exclude": ["..."],
"assetPaths": {
"Accessibility": "87125978665929",
"Add": "91287573941495",
"Add Circle": "115071695814939",
// ...
}
}
Loading icons
To get the image ID for an icon, you can index the assetPaths
object.
local icons = data.assetPaths
-- Get the asset id for 'Add' icon
local Add = icons.Add
-- Create an ImageLabel
local imageLabel = Instance.new('ImageLabel')
imageLabel.Image = `rbxassetid://{Add}`
imageLabel.Parent = gui -- Set this to your own GUI
Index all available icons
for name, url in pairs(data) do
local imageLabel = Instance.new('ImageLabel')
imageLabel.Image = `rbxassetid://{url}`
imageLabel.Name = name
imageLabel.Parent = gui
end
Notes
Icons are added and updated every release. All icons are uploaded in white, and the color can be changed using the ImageColor3
property on ImageLabel
or ImageButton
elements.
Excluded icons
Due to Roblox moderation policies, the following icons have not been uploaded:
- Square Drag
- Narrator
- Timer Off