Thread Tools Display Modes
10-29-06, 07:46 PM   #1
bbq
A Kobold Labourer
Join Date: Oct 2006
Posts: 1
Help using SetPoint() and virtual frames

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

Last edited by bbq : 10-29-06 at 08:09 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help using SetPoint() and virtual frames


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off