Originally Posted by Fizzlemizz
A simple button on the WorldMapFrame:
Lua Code:
local f = CreateFrame("Button", "AeroMaxxMapButton", WorldMapFrame, "UIPanelButtonTemplate") -- Create a standard Wow style red button (UIPanelButtonTemplate) with the name AeroMaxxMapButton and parent it to the WorldMapFrame f:SetSize(100, 25) -- Obvious f:SetFrameStrata("HIGH") -- Set the button high enought in the strata/Level stacks to be seen f:SetFrameLevel(511) f:SetPoint("TOPLEFT", 100, 0) -- Position the button's TOPLEFT corner relative to the TOPLEFT of the MapFrame (parent) f:SetText("Click Me!") -- Give it some text f:SetScript("OnClick", function(self) -- Tell the button what to do when you click it print("You clicked the:", self:GetName()) end)
|
Thanks for the reply.
I was kinda hoping to use this library, but for the life of me can I get it to work!
Others are using it however, but I can't seem to figure out what I am doing differently.
https://www.curseforge.com/wow/addon...ld-map-buttons
https://addonswow.com/krowis-world-map-buttons
https://github.com/TheKrowi/Krowi_WorldMapButtons