#What is the best way to change colour
21 messages · Page 1 of 1 (latest)
-- using Quad UI Library to implement things
local ScreenGUI = script.Parent
local Quad = require(path.to.module).Init()
local Class,Mount,Store = Quad.Class,Quad.Mount,Quad.Store
local Frame = Class "Frame"
Frame "mainFrame" {
Size = UDim2.fromScale(1,1);
Frame "Child" {
Size = UDim2.fromOffset(20,20);
};
Frame "Child" {
Size = UDim2.fromOffset(20,20);
Position = UDim2.fromOffset(30,0);
};
Frame "Child" {
Size = UDim2.fromOffset(20,20);
Position = UDim2.fromOffset(60,0);
};
Frame "Child" {
Size = UDim2.fromOffset(20,20);
Position = UDim2.fromOffset(90,0);
};
}
Mount(ScreenGUI, Store.GetObject("mainFrame"))
Store.GetObjects("Child").Size = UDim2.fromOffset(30,30)
-- You can also use EachAsync(), IsEmpty()
task.spawn(function()
while true do
Store.GetObjects("Child"):Each(function (item, index)
item.BackgroundColor3 = Color3.fromRGB(
math.random(0,255),
math.random(0,255),
math.random(0,255)
)
end)
task.wait(1)
end)
end
-- using for loop to print every children of Child Tagged Objects
for _,child in ipairs(Store.GetObjects("Child")) do
print(child)
end
What is that???
Why so complex?
Luau
Quad Library can make your custom class and make synced functions to your class
It's so useful
For pro scripting
React - styled ui programming is the best practice for learning luau
** You are now Level 8! **
local colors = {Color3.fromRGB(65, 65, 65), "Add more colors!"}
local Gui = "UR GUI DIRECTORY"
local cooldown = 1 -Set the number of seconds it should wait before switching to another color.
while true do
Gui.Color = colors[math.random(1, #colors)]
wait(cooldown)
end
That does what is needed
And is way simpler to understand
Yeah its simpler than my one but if you need 100 color-changing gui then you'd need 100 scripts
can u explain each part of it?
like im so lost lol
Or use a for loop
💀
he means u have to put it in every gui a script