function Icon.setCaption(E,c)assert(typeof(c)=="\115\116\114\105\110\103"or c==nil,"\069\120\112\101\099\116\101\100 \115\116\114\105\110\103\044 \103\111\116 "..typeof(c))E.captionText=c E.instances.captionLabel.Text=c E.instances.captionContainer.Parent=c and activeItems or E.instances.iconContainer E:_updateIconSize(nil,E:getToggleState())if E.hovering then E:_displayCaption(true)end return E end function Icon._displayCaption(E,c)local w=c if E.captionText==nil then return elseif userInputService.TouchEnabled and not E._draggingFinger then return end local Q=8 if E._draggingFinger then Q=Q+THUMB_OFFSET end local g=E.instances.iconContainer local F=E.instances.captionContainer local r=UDim2.new(0,(g.AbsolutePosition.X+g.AbsoluteSize.X/2)-F.AbsoluteSize.X/2,0,(g.AbsolutePosition.Y+g.AbsoluteSize.Y*2)+Q)F.Position=r for c,w in pairs(E._uniqueSettings.caption)do E:_update(w)end end

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
