FrameReference:SetPoint("CENTER",LinkedFrameReference,"CENTER",0,0)
It would wholly depend on how you were planning on displaying them. Here is an example from one of my current projects that positions buttons underneath each other.
because lastButton is nil when the first button is made that is coded to set the top most position. The rest all simply follow suit. This example has a button that isn't clickable but has a hover script for the tooltip and has an icon and 3 lines of text.
Code:
frame.Buttons = {}
local lastButton
for i,v in pairs(XGlyphLibraryDB) do
if ( v.GlyphID and not v[currentPlayer]) then
local button = CreateFrame("Button","$parent_Button_"..v.GlyphID,frame.scrollChild)
button:SetHeight(GLYPH_BUTTON_HEIGHT);
button:SetWidth(frame.scrollChild:GetWidth())
button.ShowTooltip = function(self)
GameTooltip:SetOwner(self, "ANCHOR_CURSOR");
GameTooltip:SetGlyphByID(v.GlyphID)
GameTooltip:AddLine(v.Class, 1.0,1.0,1.0)
GameTooltip:Show();
end
button.HideTooltip = function(self)
GameTooltip:Hide();
end
button:SetScript("OnEnter",function(self) self:ShowTooltip() end);
button:SetScript("OnLeave",function(self) self:HideTooltip() end);
button.icon = button:CreateTexture("$parent_Icon","ARTWORK");
button.icon:SetTexture(v.GlyphIcon);
button.icon:SetWidth(GLYPH_BUTTON_HEIGHT - 4)
button.icon:SetHeight(GLYPH_BUTTON_HEIGHT - 4)
button.icon:SetPoint("TOPLEFT",5,-5)
button.title = button:CreateFontString("$parent_Title","ARTWORK");
button.title:SetFontObject("GameFontNormal")
button.title:SetText(v.GlyphName)
button.title:SetJustifyH("LEFT")
button.title:SetJustifyV("MIDDLE")
button.title:SetPoint("TOPLEFT",button.icon,"TOPRIGHT",5,0)
button.title:SetPoint("TOPRIGHT",button,"TOPRIGHT")
button.class = button:CreateFontString("$parent_Class", "ARTWORK");
button.class:SetFontObject("GameFontNormal")
button.class:SetText(v.Class)
button.class:SetJustifyH("LEFT")
button.class:SetJustifyV("MIDDLE")
button.class:SetPoint("BOTTOMLEFT",button.icon,"BOTTOMRIGHT",5,0)
button.class:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT")
button.type = button:CreateFontString("$parent_Type", "ARTWORK");
button.type:SetFontObject("GameFontNormal")
button.type:SetText(GLYPH_TYPE_NAME[v.GlyphType])
button.type:SetJustifyH("LEFT")
button.type:SetJustifyV("MIDDLE")
button.type:SetPoint("LEFT",button.icon,"RIGHT",5,0)
button.type:SetPoint("CENTER",button.icon,"CENTER")
if ( not lastButton ) then
button:SetPoint("TOPLEFT",frame.scrollChild,"TOPLEFT")
else
button:SetPoint("TOPLEFT",lastButton,"BOTTOMLEFT")
end
lastButton = button
button.icon:Show()
button:Show();
tinsert(frame.Buttons,button)
end
end
end