Newbie LUA help with fontstrings
Hi there! I'm not a programmer and don't really know any languages off by heart but have a basic grasp of how coding works, so excuse any silly oversights on my part. I just couldn't find the answer to my question after a week of combing through the wow API online so I thought I'd ask. I'm making an RP addon for myself that displays, after the character has stopped moving, whether you had run or walk toggled on (as other games have this and it's useful when you're roleplaying. At least, it's useful for me!)
I've managed to make it all work, but my text is appearing piled on top of each other instead of changing each time. I assumed this was because I was accidentally creating a new font string each time instead of editing the old, but I can't find a 'delete text' function anywhere. Is this a thing? Sorry again for my dumb questions and thanks for your help! Here is my full code: Code:
frame = CreateFrame("Button", "frame", UIParent) |
You're creating a new fontstring on top of previous ones each time the OnEvent function is called. Just create one and update its text.
Code:
local frame = CreateFrame("Button", "save-disk_frame", UIParent) |
Quote:
|
Ah, of course! I feel silly for not spotting that now in all my attempts to fix it! Thank you for your help :)
|
All times are GMT -6. The time now is 11:38 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI