that does not use UIPanelButtonTemplate for a background. Would love to have a button that is just the text itself or an icon or "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_6:14:14|t" as an example.
I just like clean interfaces and believe that having just the raid icon itself against the background of the frame would be great. I could probably do it in XML but Phanx pointed out everything should be done in Lua, so I shifted my whole project to that
Lei ShenCoordinator 2.
The buttons that I currently have use the following code:
Lua Code:
local function CreateBasicButton(parent, name, text, tooltipText)
local button = CF("Button", name, parent, "SecureActionButtonTemplate, UIPanelButtonTemplate")
button.text = _G[button:GetName().."Text"]
button.text:SetText(text)
button:SetWidth(30)
button:SetHeight(30)
button:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOP")
GameTooltip:AddLine(tooltipText, 0, 1, 0.5, 1, 1, 1)
GameTooltip:Show()
end)
button:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
return button
end
--create world marker buttons
local button = CreateBasicButton(LeiShenCoordinator, "Button", "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_6:14:14|t", "Raid Marker 1\nRight-click to clear")
button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
button:SetAttribute("type", "macro")
button:SetAttribute("macrotext", format("/wm 1"))
--if not previousButton then
button:SetPoint("TOPRIGHT", LeiShenCoordinator, -120, -80)
button:SetAttribute("type2", "macro")
button:SetAttribute("macrotext2", format("/cwm 1"))
Thanks in advance!