Hello everyone, how are you?
I need a little help with an addon, and thanks in advance for any help.
I’m trying to make a time bar for buffs, and I tried using the default image UICastingBar2x.blp. The problem is that i can’t use part of the image as we naturally do in other textures, using SetTexCoord, it dont work. I tried to edit it in photoshop but there is a blank part left because it is not exactly, for example, 256 x 32, so when filling the bar, it goes beyond the border. Here’s the code I’m trying:
local BD = {
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
tile = true,
tileSize = 32,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
local eventFrame = CreateFrame("Frame", nil, nil)
eventFrame:RegisterEvent"PLAYER_ENTERING_WORLD"
local timerBar = CreateFrame("StatusBar", nil, UIParent, "BackdropTemplate")
timerBar:SetPoint("CENTER", UIParent, "TOP", 0, -100)
timerBar:SetSize(256, 9)
-- timerBar:SetStatusBarTexture("Interface\\CastingBar\\UICastingBar2x.BLP", "BORDER")
-- timerBar:SetStatusBarTexture("Interface\\AddOns\\Cooldown\\Bar", "BORDER")
-- timerBar:SetStatusBarColor(.0,1,1)
timerBar:SetBackdrop(BD)
timerBar:Hide()
local tex = timerBar:CreateTexture(nil, "ARTWORK")
tex:SetTexture"Interface\\AddOns\\Cooldown\\Bar"
tex:SetAllPoints()
timerBar:SetStatusBarTexture(tex)
tex:SetTexCoord(0.1, 0.9, 0.1, 0.9)
timerBar.Border = timerBar:CreateTexture(nil, "ARTWORK")
-- timerBar.Border:SetTexture"Interface\\CastingBar\\UI-CastingBar-Border"
timerBar.Border:SetTexture"Interface\\AddOns\\Cooldown\\Border_512"
timerBar.Border:SetSize(256, 16)
timerBar.Border:SetPoint("CENTER", timerBar, 0, 0)
timerBar:Show()