The way to make it work by anchoring is to create the frame first, then the fontstring, both with anchors not set yet. Instead of the conventional anchor fontstring to frame and frame to parent, you do the reverse. Anchor the frame to the fontstring and the fontstring to the frame's parent.
Lua Code:
local Frame=CreateFrame("Frame",nil,UIParent);
local Text=Frame:CreateFontString(nil,"OVERLAY","GameFontNormal");
Frame:SetAllPoints(Text);-- Set points for frame
Text:SetPoint("CENTER",UIParent,"CENTER",0,0);-- Move text to location