Originally Posted by Seerah
What exactly do you mean by "the rest won't show correctly"?
|
Just that exactly.
From the larger example below, there's five textures:
1 medium-transparent black rectangle, and
4 mostly-opaque medium-gray "lines" (one on each edge)
With the first rectangle specified with :SetTexture("texture"), :SetVertexColor(R, G, B, [,A]) as below, all five shapes show up correctly. But if I change the :SetTexture() to using R, G, B [,A] and remove the :SetVertexColor(), then the first gray rectangle shows up, but the four lines do not show up.
lua Code:
local mmBackdrop = CreateFrame("Frame", nil, Minimap)
mmBackdrop:SetFrameLevel(max(1, Minimap:GetFrameLevel()-2))
local mmBG = mmBackdrop:CreateTexture(nil, "ARTWORK", mmBackdrop)
mmBG:SetSize(Minimap:GetWidth() + 6, Minimap:GetHeight() + 6)
mmBG:SetPoint("CENTER", Minimap, "CENTER", 0, 0)
-- this works
mmBG:SetTexture("Interface\\Buttons\\WHITE8x8")
mmBG:SetVertexColor(0, 0, 0, 0.6)
-- but if I used the following line, then the later artwork doesn't show
-- mmBG:SetTexture(0, 0, 0, 0.6)
local mmBGT = mmBackdrop:CreateTexture(nil, "ARTWORK", mmBackdrop)
local mmBGR = mmBackdrop:CreateTexture(nil, "ARTWORK", mmBackdrop)
local mmBGB = mmBackdrop:CreateTexture(nil, "ARTWORK", mmBackdrop)
local mmBGL = mmBackdrop:CreateTexture(nil, "ARTWORK", mmBackdrop)
mmBGT:SetSize(mmBG:GetWidth() - 2, 1)
mmBGT:SetPoint("TOP", mmBG, "TOP", 0, -1)
mmBGT:SetTexture(0.4, 0.4, 0.4, 0.8)
mmBGR:SetSize(1, mmBG:GetHeight() - 2)
mmBGR:SetPoint("RIGHT", mmBG, "RIGHT", -1, 0)
mmBGR:SetTexture(0.4, 0.4, 0.4, 0.8)
mmBGB:SetSize(mmBG:GetWidth() - 2, 1)
mmBGB:SetPoint("BOTTOM", mmBG, "BOTTOM", 0, 1)
mmBGB:SetTexture(0.4, 0.4, 0.4, 0.8)
mmBGL:SetSize(1, mmBG:GetHeight() - 2)
mmBGL:SetPoint("LEFT", mmBG, "LEFT", 1, 0)
mmBGL:SetTexture(0.4, 0.4, 0.4, 0.8)
(and yes, I know it's easier to do all this with one :SetBackdrop(), this was just a proof of concept)