WoWInterface

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

Calissi 03-09-13 06: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 07: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 07:23 AM

Ty this worked :)


All times are GMT -6. The time now is 06:36 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI