You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.9 KiB

PlaterNamePlateBorderTemplateMixin = {};
local PixelUtil = PixelUtil or DFPixelUtil
function PlaterNamePlateBorderTemplateMixin:SetVertexColor(r, g, b, a)
for i, texture in ipairs(self.Textures) do
texture:SetVertexColor(r, g, b, a);
end
end
function PlaterNamePlateBorderTemplateMixin:SetBorderSizes(borderSize, borderSizeMinPixels, upwardExtendHeightPixels, upwardExtendHeightMinPixels)
self.borderSize = borderSize;
self.borderSizeMinPixels = borderSizeMinPixels;
self.upwardExtendHeightPixels = upwardExtendHeightPixels;
self.upwardExtendHeightMinPixels = upwardExtendHeightMinPixels;
end
function PlaterNamePlateBorderTemplateMixin:UpdateSizes()
local borderSize = self.borderSize or 1;
local minPixels = self.borderSizeMinPixels or 2;
local upwardExtendHeightPixels = self.upwardExtendHeightPixels or borderSize;
local upwardExtendHeightMinPixels = self.upwardExtendHeightMinPixels or minPixels;
PixelUtil.SetWidth(self.Left, borderSize, minPixels);
PixelUtil.SetPoint(self.Left, "TOPRIGHT", self, "TOPLEFT", 0, upwardExtendHeightPixels, 0, upwardExtendHeightMinPixels);
PixelUtil.SetPoint(self.Left, "BOTTOMRIGHT", self, "BOTTOMLEFT", 0, -borderSize, 0, minPixels);
PixelUtil.SetWidth(self.Right, borderSize, minPixels);
PixelUtil.SetPoint(self.Right, "TOPLEFT", self, "TOPRIGHT", 0, upwardExtendHeightPixels, 0, upwardExtendHeightMinPixels);
PixelUtil.SetPoint(self.Right, "BOTTOMLEFT", self, "BOTTOMRIGHT", 0, -borderSize, 0, minPixels);
PixelUtil.SetHeight(self.Bottom, borderSize, minPixels);
PixelUtil.SetPoint(self.Bottom, "TOPLEFT", self, "BOTTOMLEFT", 0, 0);
PixelUtil.SetPoint(self.Bottom, "TOPRIGHT", self, "BOTTOMRIGHT", 0, 0);
if self.Top then
PixelUtil.SetHeight(self.Top, borderSize, minPixels);
PixelUtil.SetPoint(self.Top, "BOTTOMLEFT", self, "TOPLEFT", 0, 0);
PixelUtil.SetPoint(self.Top, "BOTTOMRIGHT", self, "TOPRIGHT", 0, 0);
end
5 years ago
end