local n={}local I={}for n,X in pairs(script.Spritesheets:GetChildren())do I[X.Name]={}for n,r in pairs(X:GetChildren())do I[X.Name][r.Name]=(require(r)).new()end end local function X(n,X,r)local t="\088\098\111\120\079\110\101"if type(X)=="\117\115\101\114\100\097\116\097"then X=string.sub(tostring(X),14)end local u=I[t][r]if not u then warn("\067\111\117\108\100 \110\111\116 \102\105\110\100 \115\116\121\108\101\058 "..r)return end local B=u:GetSprite(n,X)return B end function n.GetImageLabel(t,n,I,r)return X("\073\109\097\103\101\076\097\098\101\108",n,I,r)end function n.GetImageButton(t,n,I,r)return X("\073\109\097\103\101\066\117\116\116\111\110",n,I,r)end return n
---This is a roblox module that has been slightly modified to provide the ImageId and ImageRectOffset/Size for gamepad button prompts.

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
