Quantcast
WoWInterface - View Single Post - Assign atlas texture to button in lua?
View Single Post
03-26-20, 07:06 AM   #6
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 365
Same deal, adjust SetTexCoord arguments until it looks ok:
Code:
local myButton = CreateFrame("Button", nil, UIParent)
myButton:SetNormalAtlas("QuestCollapse-Show-Up")
myButton:SetPushedTexture("Interface\\Buttons\\UI-SpellbookIcon-NextPage-Down")
myButton:GetPushedTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9)
myButton:SetHighlightTexture("Interface\\Buttons\\UI-Common-MouseHilight", "ADD")
myButton:GetHighlightTexture():SetTexCoord(0.15, 0.85, 0.15, 0.85)
myButton:SetSize(25, 25)
  Reply With Quote