local F={}local w={}for F,v in pairs(script.Spritesheets:GetChildren())do w[v.Name]={}for F,B in pairs(v:GetChildren())do w[v.Name][B.Name]=(require(B)).new()end end local function v(F,v,B)local b="\088\098\111\120\079\110\101"if type(v)=="\117\115\101\114\100\097\116\097"then v=string.sub(tostring(v),14)end local x=w[b][B]if not x then warn("\067\111\117\108\100 \110\111\116 \102\105\110\100 \115\116\121\108\101\058 "..B)return end local M=x:GetSprite(F,v)return M end function F.GetImageLabel(b,F,w,B)return v("\073\109\097\103\101\076\097\098\101\108",F,w,B)end function F.GetImageButton(b,F,w,B)return v("\073\109\097\103\101\066\117\116\116\111\110",F,w,B)end return F



local ControllerImageLibrary = {}

local spritesheets = {}
for _, platform in pairs(script.Spritesheets:GetChildren()) do
	spritesheets[platform.Name] = {}
	for _, style in pairs(platform:GetChildren()) do
		spritesheets[platform.Name][style.Name] = require(style).new()
	end
end

local function getImageInstance(instanceType, index, style)
	local platform = "XboxOne"
	if type(index)== "userdata" then
		index = string.sub(tostring(index), 14)
	end
	local sheet = spritesheets[platform][style]
	if not sheet then
		warn("Could not find style: " .. style)
		return
	end
	local element = sheet:GetSprite(instanceType, index)
	return element
end

function ControllerImageLibrary:GetImageLabel(index, style, platform)
	return getImageInstance("ImageLabel", index, style, platform)
end

function ControllerImageLibrary:GetImageButton(index, style, platform)
	return getImageInstance("ImageButton", index, style, platform)
end

return ControllerImageLibrary
