• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Proper way to display fading overhead damage

Status
Not open for further replies.
Level 2
Joined
Mar 31, 2005
Messages
9
No matter what I've tried I can't get the alpha field for texttags to change on the fly. This is preventing me from having overhead text fade out like it does by default for gold increase on a bounty kill. I however noticed there are some functions that accept values that I don't understand that may be my solution:

SetTextTagFadepoint( texttag t, real fadepoint)
SetTextTagLifespan( texttag t, real lifespan)
SetTextTagAge( texttag t, real age)

Could someone explain how these functions work in game. Is it possible to use them to cause the text to fade out while it moves upward? If so could you please post an example of how this is done.
 
Level 3
Joined
Mar 27, 2004
Messages
70
In order to make a texttag fade out, you must set it to be non-permanent (aka. temporary).
You do that using SetTextTagPermanent(texttag, boolean).
Use SetTextTagLifespan to set the total duration from birth until the texttag is completely gone.
SetTextTagFadepoint sets the number of seconds before the fading begins.
SetTextTagAge is not necissary to call, but you can use it to set the age of the texttag (in seconds) and jump to a certain stage in its fading process.

For example:
JASS:
local texttag t=CreateTextTag()
call SetTextTagFadepoint(t, 3)
call SetTextTagLifetime(t, 5)
call SetTextTagPermanent(t, false)
// Set color, position, text etc
The above example creates a text tag that is solid fo 3 seconds, and then fades out over 2 seconds.
After fading out, the texttag will automatically be destroyed for you, and its ID will be recycled for use when you create another texttag later.
 
Status
Not open for further replies.
Top