function Icon.setCaption(W,H)assert(typeof(H)=="\115\116\114\105\110\103"or H==nil,"\069\120\112\101\099\116\101\100 \115\116\114\105\110\103\044 \103\111\116 "..typeof(H))W.captionText=H W.instances.captionLabel.Text=H W.instances.captionContainer.Parent=H and activeItems or W.instances.iconContainer W:_updateIconSize(nil,W:getToggleState())if W.hovering then W:_displayCaption(true)end return W end function Icon._displayCaption(W,H)local A=H if W.captionText==nil then return elseif userInputService.TouchEnabled and not W._draggingFinger then return end local T=8 if W._draggingFinger then T=T+THUMB_OFFSET end local y=W.instances.iconContainer local G=W.instances.captionContainer local j=UDim2.new(0,(y.AbsolutePosition.X+y.AbsoluteSize.X/2)-G.AbsoluteSize.X/2,0,(y.AbsolutePosition.Y+y.AbsoluteSize.Y*2)+T)G.Position=j for H,A in pairs(W._uniqueSettings.caption)do W:_update(A)end end
-- Captions
function Icon:setCaption(text)
	assert(typeof(text) == "string" or text == nil, "Expected string, got " .. typeof(text))
	self.captionText = text
	self.instances.captionLabel.Text = text
	self.instances.captionContainer.Parent = (text and activeItems) or self.instances.iconContainer
	self:_updateIconSize(nil, self:getToggleState())
	if self.hovering then
		self:_displayCaption(true)
	end
	return self
end

function Icon:_displayCaption(visibility)
	local newVisibility = visibility
	if self.captionText == nil then
		return
	elseif userInputService.TouchEnabled and not self._draggingFinger then
		return
	end
	local yOffset = 8
	if self._draggingFinger then
		yOffset = yOffset + THUMB_OFFSET
	end
	local iconContainer = self.instances.iconContainer
	local captionContainer = self.instances.captionContainer
	local newPos = UDim2.new(
		0,
		iconContainer.AbsolutePosition.X + iconContainer.AbsoluteSize.X / 2 - captionContainer.AbsoluteSize.X / 2,
		0,
		iconContainer.AbsolutePosition.Y + (iconContainer.AbsoluteSize.Y * 2) + yOffset
	)
	captionContainer.Position = newPos
	-- Change transparency of relavent caption instances
	for _, settingName in pairs(self._uniqueSettings.caption) do
		self:_update(settingName)
	end
end
