View Single Post
09-17-14, 05:03 PM   #1
benots4
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 20
Overwriting text

I am making something like a scroll frame, a frame containing several rows of frames that I want to write text in and then scroll through. I can do that fine only each update writes the new text over the top of the old text, making it unreadable. Addons like Auctioneer do this all the time so I must be missing something.

Creating the subframes and text looks like this
Code:
function GGCreatePDField(Name, Parent, Point, ofsx , ofsy, fwidth, fheight, text)
	local f = CreateFrame("Frame", Name, Parent)				
	f:SetPoint(Point, ofsx,ofsy )
	f:SetWidth(fwidth)
	f:SetHeight(fheight)
	f.text = f:CreateFontString("$parentName", "OVERLAY")
	f.text:SetTextColor(1, 1, 1, 1)
	f.text:ClearAllPoints()
	f.text:SetPoint("LEFT", f, "LEFT")
	f.text:SetJustifyH("LEFT")
	f.text:SetJustifyV("TOP")
	f.text:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")
	f.text:SetText(text)
	return f.text
	end
The display loop looks like this

Code:
	for i = 1, displayRows  do
		charLevel = GGCreatePDField("Level", GroupMemberList, "TOPLEFT", 6,-ofsy , 40, 16,nil)
		charLevel:SetText(pInfoArray[v].Level)
		ofsy = ofsy + displayRowHeight
		i=i + 1
		v = v + 1
	end
  Reply With Quote