WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (http://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Updating string text (http://www.wowinterface.com/forums/showthread.php?t=46006)

Calissi 03-09-13 05:31 AM

Updating string text
 
I have an update function that updates the text, but it places it on top of the existing text is there a way to modify it.
Because there is ModifyText command.

example of what i have

Code:

function Update()
local Title = f:CreateFontString(nil, "OVERLAY", "GameFontNormal")
Title:SetPoint("Center",0,166)
Title:SetText("Title")
end


Rilgamon 03-09-13 06:01 AM

Lua Code:
  1. local Title = f:CreateFontString(nil, "OVERLAY", "GameFontNormal")
  2. Title:SetPoint("Center",0,166)
  3.  
  4. local function Update()
  5. Title:SetText("Title")
  6. end

Your function should be local. And you dont need to create a new fontstring on every update.
With settext you can modify it.

Calissi 03-09-13 06:23 AM

Ty this worked :)


All times are GMT -6. The time now is 07:55 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC