Assign atlas texture to button in lua?
I found that the equivalent to xml
Code:
<Button name="myButton"> Code:
local myButton= CreateFrame("Button", "myButton", myParentFrame) But how do I achieve a texture defined as "atlas" in lua? Code:
<NormalTexture atlas="QuestCollapse-Show-Up"/> Code:
local texture = myButton:CreateTexture() What am I missing? Thanks! |
There are methods for button objects that seem they would achieve this (never used them myself):
SetNormalAtlas SetPushedAtlas SetDisabledAtlas SetHighlightAtlas |
Ah cool! Thanks! There is odly nothing about these functions online...
Can anyone tell me why the Atlas texture is apparently always somewhat larger than the Texture texture? Code:
local myButton = CreateFrame("Button", nil, myParent) |
I'd say mess with SetTexCoord until it looks ok:
Code:
local myButton = CreateFrame("Button", nil, myParent) |
OK, that's an idea.
But let me ask differently. How can I achieve that the highlight Texture texture is shown as big as the normal Atlas texture? XML: Code:
<NormalTexture atlas="QuestCollapse-Show-Up"/> Lua: Code:
myButton:SetNormalAtlas("QuestCollapse-Show-Up") |
Same deal, adjust SetTexCoord arguments until it looks ok:
Code:
local myButton = CreateFrame("Button", nil, UIParent) |
Ah, now I get it! Thank you very much!
|
All times are GMT -6. The time now is 03:19 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI