Textanimation (counting upward)
Hi there,
has anyone a idea how to make a textanimation like the one in the artifactui? If the artifactui is opened and you add artifactpower the counter for the available power counts 'animated' upwards. |
I don't know how they do it but the general way is to make a box bigger than your fontstring, then position your font string within it in a loop with different coordinate values at increments that match the timing and speed you want.
BigWigs (Messages.lua) might be a good example of how to use animations. I think the code for what they do is in ArtifactToast.lua, if you unpack the blizzard code. |
|
Quote:
|
For whatever reason, I have no idea how to use the functions. I might be just too tired or too stupid.
|
Here's a small demo:
Lua Code:
|
Thank you for the small demo.
I have to ask, could you held me to integrade your demo into my litte addon? I am new in Lua programming. everytime a have time I read tutorial and try to learn but time for that is rare. In the ArtifactFrame I would see how many Artifactpower was assigned to my weapon, because i like statistics :) I would animate the assigned artifactpower text when new power was added and the frame was visible. Like the default available artifactpower text. Lua Code:
Of course my code is a bit dirty but it works :) |
Lua Code:
As I noted in code comments, setting "OnUpdate" the way I did isn't optimal, like at all... Read this post for more info. I also hope that tAPL, and many other variables are locals... |
Holy sh.t i thank you so much :o
|
All times are GMT -6. The time now is 02:01 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI