- Joined
- Nov 13, 2006
- Messages
- 1,814
i want reduce the potentional heavy traffic when i use floating texts in gui damage engine so planed i try this, but i cant teest it in multiplayer so i ask if this make dc or no?
if IsUnitVisible(u, GetLocalPlayer()) then
floating text header function
another question if i dont destroy the floating text in this case, then its isnt leak ? because have life span but have destroy floating text in gui too
if IsUnitVisible(u, GetLocalPlayer()) then
floating text header function
JASS:
function FT takes string txt, real fsize, unit u, integer speed, integer red, integer green, integer blue, integer alpha returns nothing
local real x
local real y
local real diff
local texttag tt
if IsUnitVisible(u, GetLocalPlayer())) then
set x = GetUnitX( u )
set y = GetUnitY( u )
set diff = StringLength( txt ) * fsize / 2.00 + 1
set tt = CreateTextTag( )
call SetTextTagText( tt, txt, fsize * 0.023 )
call SetTextTagPos( tt, x - diff, y, 100.00 )
call SetTextTagColor( tt, red, green, blue, alpha )
call SetTextTagPermanent( tt, false )
call SetTextTagLifespan( tt, 4.50 )
call SetTextTagFadepoint( tt, 2.50 )
call SetTextTagVelocity( tt, speed * 0.71 / 128 * Cos( 3.14159 / 2 ), speed * 0.71 / 128 * Sin( 3.14159 / 2 ) )
set tt = null
endif
endfunction
another question if i dont destroy the floating text in this case, then its isnt leak ? because have life span but have destroy floating text in gui too