HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Texttag Problem

09-03-2009, 08:53 AM#1
Linaze
Hey, I have a little problem with the code below. Most of it works fine, except that when a unit dies, a texttag isn't created on it, which it should, and I don't know what to do... oh well. Thanks in advance etc.
Expand JASS:
09-03-2009, 11:07 AM#2
Hans_Maulwurf
call SetTextTagVisibility(tt, true)
Also SetTextTagColor takes 0-255 instead of 0-100 and the last one (transparency) would be 0 for completely invisible and 255 for fully visible. But im not 100% sure on this.

And you may also need these later:
Collapse JASS:
    call SetTextTagVelocity(tt, 0.0, 0.04)
    call SetTextTagFadepoint(tt, 2.5)
    call SetTextTagLifespan(tt, 4.0)
    call SetTextTagPermanent(tt, false)
    set tt = null
09-03-2009, 11:42 AM#3
Linaze
Adding the "call SetTextTagVisibility(tt, true)" doesn't do shit, nor does setting the transparency to 255 instead of 0.
09-03-2009, 05:01 PM#4
TheWye
Ahh, I know this problem. Had this problem myself in the past.

The main problem is here :
Collapse JASS:
call SetTextTagText takes texttag t, string s, real height

and if you create a texttag with the GUI, it calls this native to set the text:

Collapse JASS:
function SetTextTagTextBJ takes texttag tt, string s, real size returns nothing
    local real textHeight = TextTagSize2Height(size)

    call SetTextTagText(tt, s, textHeight)
endfunction

and

Collapse JASS:
function TextTagSize2Height takes real size returns real
    return size * 0.023 / 10
endfunction

Get it :) ??

So apparently, texttag "height" is different with texttag "size", where
Code:
TexttagHeight = TexttagSize * 0.0023

so size 10 will have height = 10000/23 which means that the texttag is actually created when your unit dies but just in crazy gigantic size.