- Joined
- Mar 21, 2011
- Messages
- 1,611
Hi
I just started messing around with the world editor again and have a simple question.
I created a custom function "CreateFloatingText" which basically just creates a floating text and sets values. Now, as i want to return the texttag, i cannot null it at the end of the function. Instead, i null it in the example trigger. Is that correct?
I just started messing around with the world editor again and have a simple question.
I created a custom function "CreateFloatingText" which basically just creates a floating text and sets values. Now, as i want to return the texttag, i cannot null it at the end of the function. Instead, i null it in the example trigger. Is that correct?
JASS:
library FloatingText initializer Init
function CreateFloatingText takes string text, player p, real x, real y, real speed, real angle, real duration, real fade, boolean permanent returns texttag
local texttag t = CreateTextTag()
call SetTextTagText(t, text, 0.0345)
call SetTextTagPos(t, x, y, 100)
if (GetLocalPlayer() != p) then
call SetTextTagVisibility(t, false)
endif
call SetTextTagVelocity(t, (speed*0.071/128)*Cos(angle*bj_DEGTORAD), (speed*0.071/128)*Sin(angle*bj_DEGTORAD))
call SetTextTagPermanent(t, permanent)
call SetTextTagLifespan(t, duration)
call SetTextTagFadepoint(t, fade)
return t
endfunction
endlibrary
JASS:
local texttag t = CreateFloatingText("123abc", GetTriggerPlayer(), GetCameraTargetPositionX(), GetCameraTargetPositionY(), 80.00, GetRandomReal(1.00, 360.0), 3.00, 2.00, false)
set t = null