Categories > Coding > Lua >
RayField UI Library
Posted
So i created a script with rayfield ui library but when i want to add icons they dont show up can someone help me out?
Btw what size does the icon/image be in pixels or whatever?
Hello there.
Replied
@Cyros I edited rayfield ui with a cool key system and not the build in one. But thanks anyways!
Cancel
Post
Hello there.
Replied
Make sure you have imported the icon library you want to use. For example, if you want to use Font Awesome icons, you should add the following link to the head of your HTML document.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
Verify that the icon element is properly nested inside the element you want to add it to. For example, if you want to add an icon to a button, the icon element should be inside the button element.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<button class="ray-btn ray-btn-primary">
<i class="fa fa-heart"></i> Click me!
</button>
</body>
</html>
Cancel
Post
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
Hello there.
Replied
@TJB13022012, oops my bad, You can adjust the icon size by modifying the css rules of the 'fa' class
-- First, create a new stylesheet object
local stylesheet = game:GetService("InsertService"):LoadAsset(123456789):GetChildren()[1] -- replace 123456789 with the asset ID of your stylesheet
stylesheet.Parent = game:GetService("StarterGui")
-- Then, modify the "fa" class to set the font size to your desired value
local iconSize = 24 -- replace with the desired size
local css = stylesheet.Css:Get()
css[".fa"] = {
fontSize = tostring(iconSize) .. "px",
}
stylesheet.Css:Set(css)
Cancel
Post
https://media.discordapp.net/attachments/979069297374671018/1078367228593971362/VelvetSiggy.png
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post