Currently I have the following code:
Code:
PixelSet = {}
PixelSet.main = CreateFrame("Frame", nil, UIParent)
PixelSet.main:SetHeight(3)
PixelSet.main:SetWidth(6*3)
PixelSet.children = {}
PixelSet.colors = {}
for i=1,6 do
PixelSet.children[i] = CreateFrame("Frame", "Num"..i, PixelSet.main, "ColorMePinkPixel")
PixelSet.children[i]:ClearAllPoints()
PixelSet.children[i]:SetPoint("TOPLEFT", PixelSet.main, (i-1)*3, 0)
PixelSet.colors[i] = getglobal(PixelSet.children[i]:GetName().."Color")
end
and
Code:
<Frame name="ColorMePinkPixel" virtual="true">
<Size>
<AbsDimension x="3" y="3" />
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentColor">
<Color r="1.0" g="1.0" b="1.0" a="1.0"/>
</Texture>
</Layer>
</Layers>
</Frame>
What I want to do is arrange 6 3x3 boxes into a 18x3 row. I can do this easily if I make a normal, non-virtual frame, but if I try to use lua it just doesn't work. I get a single 3x3 box. All of them are there as far as I can tell, because none turn up as nil when I check.
I've tried many different combinations of SetPoint(), including setting top, left, bottom, and right individually and playing around with the parent parameters.
Also, working with what I have at the moment, PixelSet.main:SetScale() doesn't seem to work.
Any help with either of these probems would be greatly appreciated.
Edit: OK, I fixed it. Forgot to use SetPoint() on PixelSet.main