13lade619
is now a game developer :)
- Reaction score
- 398
setting up floating texts is annoying right?
you call more than 5 functions yourself + most of them are BJs,
so here's a solution:
A text tag function that takes all the necessary arguments,
and no nasty BJs to get in the way (all calculations done inside BJs are redone).
Use:
or
*Create a trigger, name it NewTextTag and paste the entire code.
**Or copy the code inside the library and paste in in the Map Header.
***Or copy the code inside the library inside your own library of custom functions.
*JASS / GUI Custom Script
*Leakless, since lifespan destroys the texttag after.
*RGB values take 0 to 255, not percentage.
*Alpha 0 is transparent, 255 is opaque.
*Functions return texttags, so you can manipulate them later (within their lifespan ofc).
*If you set permanence to false, be sure to destroy the text tag after.
Feel free to use. .
you call more than 5 functions yourself + most of them are BJs,
so here's a solution:
A text tag function that takes all the necessary arguments,
and no nasty BJs to get in the way (all calculations done inside BJs are redone).
JASS:
library NewTextTag
function NewTextTagUnitFunc takes string txtstring,real size,unit U,real zOff,integer red,integer green,integer blue,integer alpha,boolean perma,real speed,real angle,real life,real fade returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, txtstring, (size * 0.0023))
call SetTextTagPosUnit(bj_lastCreatedTextTag,U,zOff)
call SetTextTagColor(bj_lastCreatedTextTag,red,green,blue,alpha)
call SetTextTagPermanent( bj_lastCreatedTextTag, perma )
call SetTextTagVelocity(bj_lastCreatedTextTag, (speed * 0.0005546875) * Cos(angle * bj_DEGTORAD) , (speed * 0.0005546875) * Sin(angle * bj_DEGTORAD))
call SetTextTagLifespan(bj_lastCreatedTextTag, life )
call SetTextTagFadepoint(bj_lastCreatedTextTag, fade )
return bj_lastCreatedTextTag
endfunction
function NewTextTagPointFunc takes string txtstring,real size,real x, real y,real zOff,integer red,integer green,integer blue,integer alpha,boolean perma,real speed,real angle,real life,real fade returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag, txtstring, (size * 0.0023))
call SetTextTagPos(bj_lastCreatedTextTag, x, y, zOff)
call SetTextTagColor(bj_lastCreatedTextTag,red,green,blue,alpha)
call SetTextTagPermanent( bj_lastCreatedTextTag, perma )
call SetTextTagVelocity(bj_lastCreatedTextTag, (speed * 0.0005546875) * Cos(angle * bj_DEGTORAD) , (speed * 0.0005546875) * Sin(angle * bj_DEGTORAD))
call SetTextTagLifespan( bj_lastCreatedTextTag, life )
call SetTextTagFadepoint( bj_lastCreatedTextTag, fade )
return bj_lastCreatedTextTag
endfunction
endlibrary
Use:
JASS:
or
JASS:
*Create a trigger, name it NewTextTag and paste the entire code.
**Or copy the code inside the library and paste in in the Map Header.
***Or copy the code inside the library inside your own library of custom functions.
*JASS / GUI Custom Script
*Leakless, since lifespan destroys the texttag after.
*RGB values take 0 to 255, not percentage.
*Alpha 0 is transparent, 255 is opaque.
*Functions return texttags, so you can manipulate them later (within their lifespan ofc).
*If you set permanence to false, be sure to destroy the text tag after.
Feel free to use. .