Basic macro help

Trying to make a macro (and eventually a small personal addon) to simply move the default Tooltip. Using fstack I get the tool tips’ name is - GameTooltip . Using that I tried:

/run GameTooltip:ClearAllPoints()

/run GameTooltip:Setpoint(“Center”, 30, 265)

/run GameTooltip.SetPoint = function() end

coords don’t matter obvs, but must have something set wrong as all this does is blank the text out of the tooltip and leave the healthbar at it’s bottom?

/run GameTooltip:Setpoint("Center", 30, 265)

Point needs a capital P

The tooltip parent changes as required so the relative anchor to point can change with it.

Probably better with something along the lines of:

/run hooksecurefunc("GameTooltip_SetDefaultAnchor", function(self) self:ClearAllPoints() self:SetPoint("CENTER", UIParent, 30, 265) end)

Other tooltip addons not withstanding.

Thank you SO much! Works like a charm.

Can something similar to this be used in Classic? Hooksecure doesn’t seem to be supported. That may change with TBC using Shadowlands as the base, dunno.

It should be usable “as is” in retail and classic. Lua is case sensitive so check that if you change anything.

The script only changes the default anchoring position. Addons can set where the tooltip displays for individual frames (buttons, units, bag items etc.) and these will override the default.