Code:
local Button = CreateFrame("Button", "MyButton", UIParent); Button:SetWidth(150); Button:SetHeight(25); Button:SetPoint("TOP"); Button:SetText("Dance"); local ButtonTexture = Button:CreateTexture("BNT", "BACKGROUND"); ButtonTexture:SetTexture("Interface\\AddOns\\EmX_LuaOnlyFrame\\Bnormal.tga"); ButtonTexture:SetAllPoints(Button); Button:SetNormalTexture(ButtonTexture); ButtonTexture:SetBlendMode("DISABLE"); ButtonTexture = Button:CreateTexture("BHT", "BACKGROUND"); ButtonTexture:SetTexture("Interface\\AddOns\\EmX_LuaOnlyFrame\\Bhighlight.tga"); ButtonTexture:SetAllPoints(Button); Button:SetHighlightTexture(ButtonTexture); ButtonTexture:SetBlendMode("DISABLE"); ButtonTexture = Button:CreateTexture("BPT", "BACKGROUND"); ButtonTexture:SetTexture("Interface\\AddOns\\EmX_LuaOnlyFrame\\Bpush.tga"); ButtonTexture:SetAllPoints(Button); Button:SetPushedTexture(ButtonTexture); ButtonTexture:SetBlendMode("DISABLE"); ButtonTexture = Button:CreateTexture("BDT", "BACKGROUND"); ButtonTexture:SetTexture("Interface\\AddOns\\EmX_LuaOnlyFrame\\Bdisable.tga"); ButtonTexture:SetAllPoints(Button); Button:SetDisabledTexture(ButtonTexture); ButtonTexture:SetBlendMode("DISABLE"); Button:RegisterForClicks("AnyUp") Button:SetScript("OnClick", function() print("Der Button funktioniert.") end )
Jetzt möchte ich nur mal gern wissen, was an dem Code falsch ist, dass sich die Textur beim anklicken nicht verändert und was ich an dem Code ändern muss, damit es funktioniert.