• 🏆 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] How can you create Floating Texts without using BJs?

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2009
Messages
279
Could somebody explain to me what im doing wrong with this function? PLZ???

JASS:
function LOLOMG takes nothing returns nothing
    local unit u = GetKillingUnit()
    local texttag t = CreateTextTag()
    call SetTextTagPosUnit(t, u, 0)
    call SetTextTagText( t, "DIE SCUM!!!", 10)
    call SetTextTagColor(t, 80, 20, 100, 0)
    endfunction 
    
//===========================================================================
function InitTrig_DIESCUM takes nothing returns nothing
    local trigger TRG = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( TRG, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( TRG, function LOLOMG )
endfunction
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Yeah, but BJs 10 is different measurement. Just look in blizzard.j, see how the functions work.

Also it's 100% transparent. SetTextTagColor takes values in range 0-255, with 255 being full color/full visible. So alpha=0 makes it invisible
correct would be:
JASS:
    call SetTextTagText( t, "DIE SCUM!!!", 0.03)
    call SetTextTagColor(t, 200, 50, 255, 255)

EDIT: this function is used by BJs functions:
JASS:
/===========================================================================
// Scale the font size linearly such that size 10 equates to height 0.023.
// Screen-relative font heights are harder to grasp and than font sizes.
//
function TextTagSize2Height takes real size returns real
    return size * 0.023 / 10
endfunction
 
Level 7
Joined
Nov 6, 2009
Messages
279
Yeah, but BJs 10 is different measurement. Just look in blizzard.j, see how the functions work.

Also it's 100% transparent. SetTextTagColor takes values in range 0-255, with 255 being full color/full visible. So alpha=0 makes it invisible
correct would be:
JASS:
    call SetTextTagText( t, "DIE SCUM!!!", 0.03)
    call SetTextTagColor(t, 200, 50, 255, 255)

EDIT: this function is used by BJs functions:
JASS:
/===========================================================================
// Scale the font size linearly such that size 10 equates to height 0.023.
// Screen-relative font heights are harder to grasp and than font sizes.
//
function TextTagSize2Height takes real size returns real
    return size * 0.023 / 10
endfunction

What are you talking 255 is 100% trasparent
 
Status
Not open for further replies.
Top