• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Easy Floating Text Script!

Status
Not open for further replies.
Level 6
Joined
Aug 15, 2007
Messages
209
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:
Level 6
Joined
Aug 15, 2007
Messages
209
Silvenon, there could be many others of these, but I am not aware of them. It was only intended to help people. If you feel it necesary to point out that I'm being redundant, then go ahead.

Cherol, its a JASS function that creates a moving floating text at a target point. Useful for autocast triggers.
 
Status
Not open for further replies.
Top