I found that the equivalent to xml
Code:
<Button name="myButton">
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Up"/>
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Down"/>
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
can be achieved in lua as follows:
Code:
local myButton= CreateFrame("Button", "myButton", myParentFrame)
myButton:SetNormalTexture("Interface\\Buttons\\UI-SpellbookIcon-PrevPage-Up")
myButton:SetPushedTexture("Interface\\Buttons\\UI-SpellbookIcon-PrevPage-Down")
myButton:SetDisabledTexture("Interface\\Buttons\\UI-SpellbookIcon-PrevPage-Disabled")
myButton:SetHighlightTexture("Interface\\Buttons\\UI-Common-MouseHilight", "ADD")
But how do I achieve a texture defined as "atlas" in lua?
Code:
<NormalTexture atlas="QuestCollapse-Show-Up"/>
<PushedTexture atlas="QuestCollapse-Show-Down"/>
I tried
Code:
local texture = myButton:CreateTexture()
texture:SetAtlas("QuestCollapse-Show-Up")
myButton:SetNormalTexture(texture)
but this did no show any texture.
What am I missing? Thanks!