HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Text with JASS!!

05-22-2007, 06:36 AM#1
Get Undeniable Interest
Just want to know if there is anyway to make text bigger, centered and appear one letter at a time.
TY in advance
05-22-2007, 02:07 PM#2
Vexorian
Centered is easy with normal text, the rest might get better with floating text.
05-22-2007, 05:51 PM#3
Pyrogasm
Try Pitzermike's TextSplat Library?
05-22-2007, 09:08 PM#4
MaD[Lion]
textsplat doesnt move with the screen XD
05-23-2007, 05:57 AM#5
Get Undeniable Interest
o.k but what about appearing 1 letter at a time?And i know it can be done because ive seen it in Humans Vs Orcs
05-23-2007, 06:22 AM#6
Pyrogasm
If it's floating text, the text of the floating text is probably changed via a timer. Here's a JASS function that would do such a thing:
Collapse JASS:
function DisplayTextPeriodicallyCallback takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local texttag TargetText = GetAttachedTextTag(T, "Periodic TextTag")
    local string Text = GetAttachedString(T, "Periodic Text")
    local integer Iteration = GetAttachedInt(T, "Iteration")
    local integer Length = StringLength(Text)

    set Iteration = Iteration + 1
    call SetTextTagText(TargetText, Substring(Text, 1, Iteration))
    call AttachInt(T, "Iteration", Iteration)
    if Iteration >= Length then
       call PauseTimer(T)
       call CleanAttachedVars(T)
       call DestroyTimer()
    endif

    set T = null
    set Text = ""
    set TargetText = null
endfunction

function DisplayTextPeriodically takes texttag TargetText, string Text, real TimeDelay returns nothing
    local timer T = CreateTimer()
    call AttachObect(T, "Periodic TextTag", TargetText)
    call AttachString(T, "Periodic Text", Text)
    call AttachInt(T, "Iteration", 1)
    call TimerStart(T, TimeDelay, true, function DisplayTextPeriodicallyCallback)
    call SetTextTagText(TargetText, Substring(Text, 1, 1))
    set T = null
endfunction
You'd have to do something a bit more complicated if the text contained color codes, and that code leaks strings (nothing to do about that).
05-23-2007, 09:55 AM#7
Tide-Arc Ephemera
I think he means messages sent to players, but I don't think it's possible.
05-23-2007, 10:36 PM#8
Thunder_Eye
It's possible, but you'll have to clear the screen everytime a new letter is to appear.
05-24-2007, 11:06 PM#9
Get Undeniable Interest
ok ill try the clear screen thing ty
05-25-2007, 01:49 AM#10
MaD[Lion]
you can always use custom fade filter ^^