I’m trying to change the color of a button, which doesn’t seem to work, aswell as adding an Image.
For the Image:
I tried doing it with the IUPweb browser so it could load the image, it worked, however I dont really like that it still got the sidebar etc. so that’s no option.
Also tried iup.LoadImage but it didn’t work for me either.
I preferebly use the iamges with links, however if there’s no other option I can use Image Files also
require("iuplua")
local screenWidth, screenHeight = 1920, 1080
local windowWidth = screenWidth * 0.4
local windowHeight = screenHeight * 0.3
local Data = {
["Industrialist"] = {
Image = "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg",
ID = "9192423027"
},
["Engineer"] = {
Image = "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg",
ID = "9192423027"
},
["Scientist"] = {
Image = "https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg",
ID = "9192423027"
},
}
local Instances = {}
function createInstance(Title, Data)
local label = iup.label{
title = Title,
alignment = "ACENTER",
valign = "TOP",
halign = "CENTER",
fgcolor = "255 255 255"
}
local button = iup.button{
title = "Open",
bgcolor = "2 183 87",--"#02b757"
alignment = "ACENTER",
size = "100x30",
action = function()
local link = "roblox://placeId=" .. Data.ID
os.execute('start "" "' .. link .. '"')
end
}
local Image = iup.label{image = iup.LoadImage("Images/Industrialist.png")}
--THIS DID NOT WORK
-- Creating the container for the components
local container = iup.vbox{
label,
Image,
button,
alignment = "ACENTER",
valign = "CENTER",
halign = "CENTER",
size = "150x200",
expand = "YES"
}
return container
end
for i, v in pairs(Data) do
table.insert(Instances, createInstance(i, v))
end
local gridBox = iup.gridbox{
orientation = "HORIZONTAL",
numdiv = 3,
alignment = "ACENTER",
expand = "YES",
table.unpack(Instances)
}
local dlg = iup.dialog{
gridBox,
title = "Alchemister",
size = windowWidth.."x"..windowHeight,
bgcolor = "17 18 22",
resize = "YES"
}
dlg:show()
iup.MainLoop()
user28944982 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.