• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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