I made an easy to use floating text function that is good for showing damage done and temporary things like that. It takes the string you want made into the floating text, the string for what color you want (options are "red","orange","yellow","green","blue","purple", and "black"). And then the coordinates for where you want it to be placed. It has a 3 second lifespan, but I think you could figure it out if you wanted to change that.
JASS:
function Text takes string s, string color, real x, real y returns nothing
local texttag t = CreateTextTag()
call SetTextTagText(t, s, .023)
call SetTextTagPos(t, x,y, 100)
call SetTextTagVelocity(t, 0, .0277)
if color == "red" then
call SetTextTagColor(t, 255, 0, 0, 255)
elseif color == "orange" then
call SetTextTagColor(t, 255, 138, 8, 255)
elseif color == "yellow" then
call SetTextTagColor(t, 255, 255, 0, 255)
elseif color == "green" then
call SetTextTagColor(t, 24, 190, 0, 255)
elseif color == "blue" then
call SetTextTagColor(t, 0, 0, 255, 255)
elseif color == "purple" then
call SetTextTagColor(t, 82, 0, 132, 255)
elseif color == "black" then
call SetTextTagColor(t, 0,0,0, 255)
endif
call SetTextTagLifespan( t, 3.00 )
call SetTextTagFadepoint( t, 2.00 )
call SetTextTagPermanent( t, false )
set t = null
endfunction
Last edited: