Skip to content

Instantly share code, notes, and snippets.

@Meorawr
Created April 18, 2024 21:50
Show Gist options
  • Save Meorawr/7826faadfb7e0a4b1b19c0b26ca6026d to your computer and use it in GitHub Desktop.
Save Meorawr/7826faadfb7e0a4b1b19c0b26ca6026d to your computer and use it in GitHub Desktop.
function CreateTestFrame(parent, text, color)
local frame = CreateFrame("Frame", nil, parent)
frame.Bg = frame:CreateTexture()
frame.Bg:SetAllPoints(frame)
frame.Bg:SetColorTexture(color:GetRGBA())
frame.Text = frame:CreateFontString(nil, nil, "GameFontNormalHuge")
frame.Text:SetAllPoints(frame)
frame.Text:SetText(text)
frame:SetCollapsesLayout(true)
return frame
end
GridFrame = CreateTestFrame(nil, nil, CreateColor(1, 1, 1, 0.25))
GridFrame:SetPoint("CENTER")
GridFrame:SetSize(340, 340)
Cell1 = CreateTestFrame(GridFrame, "1", CreateColor(1, 0, 0, 0.5))
Cell1:SetPoint("TOPLEFT", 10, -10)
Cell1:SetSize(100, 100)
Cell2 = CreateTestFrame(GridFrame, "2", CreateColor(0, 1, 0, 0.5))
Cell2:SetPoint("LEFT", Cell1, "RIGHT", 10, 0)
Cell2:SetSize(100, 100)
Cell3 = CreateTestFrame(GridFrame, "3", CreateColor(0, 0, 1, 0.5))
Cell3:SetPoint("LEFT", Cell2, "RIGHT", 10, 0)
Cell3:SetSize(100, 100)
Cell4 = CreateTestFrame(GridFrame, "4", CreateColor(1, 0, 0, 0.5))
Cell4:SetPoint("TOP", Cell1, "BOTTOM", 0, -10)
Cell4:SetSize(100, 100)
Cell5 = CreateTestFrame(GridFrame, "5", CreateColor(0, 1, 0, 0.5))
Cell5:SetPoint("LEFT", Cell4, "RIGHT", 10, 0)
Cell5:SetSize(100, 100)
Cell6 = CreateTestFrame(GridFrame, "6", CreateColor(0, 0, 1, 0.5))
Cell6:SetPoint("LEFT", Cell5, "RIGHT", 10, 0)
Cell6:SetSize(100, 100)
Cell7 = CreateTestFrame(GridFrame, "7", CreateColor(1, 0, 0, 0.5))
Cell7:SetPoint("TOP", Cell4, "BOTTOM", 0, -10)
Cell7:SetSize(100, 100)
Cell8 = CreateTestFrame(GridFrame, "8", CreateColor(0, 1, 0, 0.5))
Cell8:SetPoint("LEFT", Cell7, "RIGHT", 10, 0)
Cell8:SetSize(100, 100)
Cell9 = CreateTestFrame(GridFrame, "9", CreateColor(0, 0, 1, 0.5))
Cell9:SetPoint("LEFT", Cell8, "RIGHT", 10, 0)
Cell9:SetSize(100, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment