Quantcast
WoWInterface - View Single Post - Overlapping NineSlice textures with ButtonFrameTemplate
View Single Post
03-31-20, 08:21 AM   #15
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 363
Both regions are sharing a layer so you need to make sure the subLevel of your new texture is greater than the other:
Code:
local layer, subLevel = myFrame.NineSlice.TopRightCorner:GetDrawLayer()
myFrame.exportButton.btnDivLeft = myFrame.NineSlice:CreateTexture("cosFix_btnDivLeft")
myFrame.exportButton.btnDivLeft:SetDrawLayer(layer, subLevel + 1)
myFrame.exportButton.btnDivLeft:SetPoint("RIGHT", myFrame.exportButton, "LEFT", 5, 0)
myFrame.exportButton.btnDivLeft:SetAtlas("UI-Frame-BtnDivLeft", true)
local oldX, oldY = myFrame.exportButton.btnDivLeft:GetSize()
local shrinkFactor = 0.854
myFrame.exportButton.btnDivLeft:SetSize(oldX*shrinkFactor, oldY*shrinkFactor)
Edit: Or you could have used different layers:
Code:
myFrame.NineSlice.TopRightCorner:SetDrawLayer("BORDER")
myFrame.exportButton.btnDivLeft = myFrame.NineSlice:CreateTexture("cosFix_btnDivLeft", "OVERLAY")
myFrame.exportButton.btnDivLeft:SetPoint("RIGHT", myFrame.exportButton, "LEFT", 5, 0)
myFrame.exportButton.btnDivLeft:SetAtlas("UI-Frame-BtnDivLeft", true)
local oldX, oldY = myFrame.exportButton.btnDivLeft:GetSize()
local shrinkFactor = 0.854
myFrame.exportButton.btnDivLeft:SetSize(oldX*shrinkFactor, oldY*shrinkFactor)

Last edited by Vrul : 03-31-20 at 08:26 AM.
  Reply With Quote