Thread Tools Display Modes
07-25-12, 07:08 AM   #1
Pypper
A Defias Bandit
Join Date: Jul 2012
Posts: 2
Clearing text

I am using LibRangeCheck for an addon. I created a frame and output the range to this frame. The text is updated via OnUpdate(). The problem I am having is that the text writes on top of the previous text without any clearing of the text. Is there any way to fix this?

Code:
function OrbMaster:CheckHaloRange()
	local minRange, maxRange = rc:GetRange('target')
	distanceFrame:Show()
	if minRange and maxRange then
		local t = distanceFrame:CreateFontString(nil, "BACKGROUND")
		t:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
		t:SetPoint("CENTER")
		t:SetJustifyH("CENTER")
		t:SetText(minRange .. "-" .. maxRange .. " yds")
	end
end
  Reply With Quote
07-25-12, 07:13 AM   #2
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
You're creating a frame every update. Just use SetText inside the OnUpdate function.

Last edited by Freebaser : 07-25-12 at 07:21 AM. Reason: fail grammar
  Reply With Quote
07-25-12, 07:15 AM   #3
Pypper
A Defias Bandit
Join Date: Jul 2012
Posts: 2
Originally Posted by Freebaser View Post
Your creating a frame every update. Just use SetText inside the OnUpdate function.
Oh, word. Thank you.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Clearing text


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