• 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] Why does not this texttag work??

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
ok i have tried for hours now without getting any result -.- why does this not work...

JASS:
function bleh takes nothing returns nothing
    local texttag TT = CreateTextTag()
    call SetTextTagColor(TT,100,75,25,0)
    call SetTextTagPos(TT,X,Y,0)
    call SetTextTagText(TT,"BLEH",10)
    call SetTextTagVelocity(TT,64,90)
    call SetTextTagPermanent(TT,false)
    call SetTextTagFadepoint(TT,0.5)
    call SetTextTagLifespan(TT,2)
    call SetTextTagVisibility(TT,true)
    set TT = null
endfunction

Any ideas on how it might work??? i cant get it to appear, hmm...
 
Level 11
Joined
Feb 22, 2006
Messages
752
Ghost wolf is right, the natives for texttags are annoyingly confusing and not worth the trouble, since the BJs don't leak and unless you're creating hundreds of texttags per second, the extra function calls aren't going to make a difference.

So what ARE the problems with these natives? First of all, the parameter "height" in SetTextTagText() is NOT the same as the paramter "size" in all the BJs. In fact, height = size * 0.023 / 10 (don't ask me why though). So, by putting in 10 for height, you are essentially making your font REALLY BIG, and the texttag won't show up (probably cuz the engine just doesn't support heights that large). Second of all, the "xvel" and "yvel" parameters in SetTextTagVelocity once again is not the same as the speed parameters in the BJ functions. This time, vel = speed * 0.071 / 128. So once again, by setting your velocities to 64 and 90, even if you fixed the height issue, your texttag would fly off the screen faster than your eye could catch it.

However, EVEN IF you fix the two issues I just mentioned, creating a texttag this way for some inexplicable reason results in a slight lag time between the time at which these functions are (or should be) executed and the time at which the texttag actually shows up on the screen. If you just use CreateTextTagLocBJ() and then set your visibility, permanence, fade, and lifespan using the natives, there will be no lag time.
 
Status
Not open for further replies.
Top