local Y={}Y.__index=Y Y.ClassName="\070\097\107\101\083\107\121\098\111\120\083\105\100\101"Y.CanvasSize=1024 Y.PartWidth=1 function Y.new(w,T,t)local M=setmetatable({},Y)M.PartSize=w or error("\078\111 \080\097\114\116\083\105\122\101")M.Transparency=1 M.Normal=T or error("\078\111 \078\111\114\109\097\108")M.Part=Instance.new("\080\097\114\116")M.Part.Name="\083\107\121\098\111\120\083\105\100\101"..M.Normal.Name M.Part.Anchored=true M.Part.Transparency=1 M.Part.CanCollide=false M.SurfaceGui=Instance.new("\083\117\114\102\097\099\101\071\117\105")M.SurfaceGui.Adornee=M.Part M.SurfaceGui.CanvasSize=Vector2.new(M.CanvasSize,M.CanvasSize)M.SurfaceGui.LightInfluence=0 M.SurfaceGui.Face=Enum.NormalId.Front M.SurfaceGui.Parent=M.Part local p=Instance.new("\073\109\097\103\101\076\097\098\101\108")p.AnchorPoint=Vector2.new(.5,.5)p.Position=UDim2.new(.5,0,.5,0)p.Size=UDim2.new(1,0,1,0)p.ImageTransparency=M.Transparency p.BackgroundColor3=Color3.new(0,0,0)p.BackgroundTransparency=1 p.BorderSizePixel=0 p.Parent=M.SurfaceGui M.ImageLabel=p M:UpdateSizing()M.Part.Parent=t return M end function Y.SetPartSize(w,Y)w.PartSize=Y or error("\078\111 \080\097\114\116\083\105\122\101")w:UpdateSizing()return w end function Y.UpdateSizing(Y)Y.Part.Size=Vector3.new(Y.PartSize,Y.PartSize,Y.PartWidth)local w=Vector3.FromNormalId(Y.Normal)local T=(w*Y.PartWidth)/2 Y.Relative=CFrame.new(w*(Y.PartSize/2)+T)*CFrame.new(Vector3.new(0,0,0),-w)if Y.Normal==Enum.NormalId.Bottom then Y.Relative=Y.Relative*CFrame.Angles(0,0,math.pi)end end function Y.SetImage(w,Y)w.ImageLabel.Image=Y return w end function Y.SetTransparency(w,Y)w.Transparency=Y or error("\078\111 \084\114\097\110\115\112\097\114\101\110\099\121")w.ImageLabel.ImageTransparency=Y return w end function Y.UpdateRender(w,Y)w.Part.CFrame=Y*w.Relative end return Y
local FakeSkyboxSide = {}
FakeSkyboxSide.__index = FakeSkyboxSide
FakeSkyboxSide.ClassName = "FakeSkyboxSide"
FakeSkyboxSide.CanvasSize = 1024
FakeSkyboxSide.PartWidth = 1

function FakeSkyboxSide.new(PartSize, Normal, Parent)
	local self = setmetatable({}, FakeSkyboxSide)

	self.PartSize = PartSize or error("No PartSize")
	self.Transparency = 1
	self.Normal = Normal or error("No Normal")

	self.Part = Instance.new("Part")
	self.Part.Name = "SkyboxSide" .. self.Normal.Name
	self.Part.Anchored = true
	self.Part.Transparency = 1
	self.Part.CanCollide = false

	self.SurfaceGui = Instance.new("SurfaceGui")
	self.SurfaceGui.Adornee = self.Part
	self.SurfaceGui.CanvasSize = Vector2.new(self.CanvasSize, self.CanvasSize)
	self.SurfaceGui.LightInfluence = 0
	self.SurfaceGui.Face = Enum.NormalId.Front
	self.SurfaceGui.Parent = self.Part

	local ImageLabel = Instance.new("ImageLabel")
	ImageLabel.AnchorPoint = Vector2.new(0.5, 0.5)
	ImageLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
	ImageLabel.Size = UDim2.new(1, 0, 1, 0)
	ImageLabel.ImageTransparency = self.Transparency
	ImageLabel.BackgroundColor3 = Color3.new(0, 0, 0)
	ImageLabel.BackgroundTransparency = 1
	ImageLabel.BorderSizePixel = 0

	ImageLabel.Parent = self.SurfaceGui
	self.ImageLabel = ImageLabel

	self:UpdateSizing()

	self.Part.Parent = Parent

	return self
end

function FakeSkyboxSide:SetPartSize(PartSize)
	self.PartSize = PartSize or error("No PartSize")
	self:UpdateSizing()

	return self
end

function FakeSkyboxSide:UpdateSizing()
	self.Part.Size = Vector3.new(self.PartSize, self.PartSize, self.PartWidth)

	local Direction = Vector3.FromNormalId(self.Normal)
	local Offset = Direction * self.PartWidth/2

	self.Relative = CFrame.new(Direction*(self.PartSize/2) + Offset)
		* CFrame.new(Vector3.new(0, 0, 0), -Direction)

	if self.Normal == Enum.NormalId.Bottom then
		-- Hack
		self.Relative = self.Relative * CFrame.Angles(0, 0, math.pi)
	end
end

function FakeSkyboxSide:SetImage(Image)
	self.ImageLabel.Image = Image

	return self
end

function FakeSkyboxSide:SetTransparency(Transparency)
	self.Transparency = Transparency or error("No Transparency")
	self.ImageLabel.ImageTransparency = Transparency

	return self
end

function FakeSkyboxSide:UpdateRender(RelativeCFrame)
	self.Part.CFrame = RelativeCFrame * self.Relative
end

return FakeSkyboxSide