TextTag - What Am I Missing?

Tyrulan

Ultra Cool Member
Reaction score
37
JASS:
    function FloatTextOnUnit takes string text, unit u, integer r, integer g, integer b returns nothing
        local texttag t = CreateTextTag()
        local real textHeight = 0.023
        local real velocity = 0.044375
        local real xvelocity = velocity * Cos(90 * bj_DEGTORAD)
        local real yvelocity = velocity * Sin(90 * bj_DEGTORAD)
        
        call SetTextTagText(t, text, textHeight)
        call SetTextTagPosUnit(t, u, 7.00)
        call SetTextTagColor(t, r, b, g, 0)
        call SetTextTagVelocity(t, xvelocity, yvelocity)        
        call SetTextTagPermanent(t, false)
        call SetTextTagLifespan(t, 2.00)    
endfunction
 

Nherwyziant

Be better than you were yesterday :D
Reaction score
96
It's this line
JASS:
call SetTextTagVelocity(t, xvelocity, yvelocity)

JASS:
function SetTextTagVelocityBJ takes texttag tt, real speed, real angle returns nothing
    local real vel = TextTagSpeed2Velocity(speed)
    local real xvel = vel * Cos(angle * bj_DEGTORAD)
    local real yvel = vel * Sin(angle * bj_DEGTORAD)

    call SetTextTagVelocity(tt, xvel, yvel)
endfunction


Set it to BJ or just do this

JASS:
local texttag t = CreateTextTag()

call SetTextTagText(<Insert Text ^_^>,"origin",0.023)
call SetTextTagPos(t,X,Y,GetUnitFlyHeight(GetTriggerUnit()))
call SetTextTagColor(t,255,255,255,255)
call SetTextTagFadepoint(t,3.)
call SetTextTagPermanent(t,false)
call SetTextTagVelocity(t,0,0.0455)
call SetTextTagLifespan(t,4.)
call SetTextTagVisibility(t,true)
 

Tyrulan

Ultra Cool Member
Reaction score
37
That was not the problem.

However you inadvertently solved my problem anyway!

It was here:

JASS:
call SetTextTagColor(t, r, g, b, 0)


I figured 0 transparency meant it was visible. :p

Thanks NHer.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top