HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with PetzerMike's TextSplat System

09-21-2008, 11:21 AM#1
Linaze
Hello dear coders of wc3c.

--Me and my friend are working on a campaign together, but that has nothing to do with this, however, for the Credits part, we were planning a map with a totally black background, that part has of course already been taken care of. For the "floating text", we were going to use PitzerMike's TextSplat system which in our opinion looks awesome and all. A link to the system can be found here. We are going to use the "Mono" TextSplat as the text should all be in the same color, I based my code on his to begin with, to just try and get it to work and learn from there.
Collapse JASS:
function Movement9Sin100 takes nothing returns nothing
    call TextSplatSetMovementResult(Sin(TextSplatGetMovementExecCount() * 9.0 * bj_DEGTORAD) * 100.0)
endfunction

function Movement45Sin10 takes nothing returns nothing
    call TextSplatSetMovementResult(Sin(TextSplatGetMovementExecCount() * 45.0 * bj_DEGTORAD) * 10.0)
endfunction

function Movement2Sin250 takes nothing returns nothing
    call TextSplatSetMovementResult(Sin(TextSplatGetMovementExecCount() * 2.0 * bj_DEGTORAD) * 200.0)
endfunction

function Movement2Sin250Shifted takes nothing returns nothing
    call TextSplatSetMovementResult(Sin((TextSplatGetMovementExecCount() * 2.0 + 90.0) * bj_DEGTORAD) * 200.0 - 200.0)
endfunction

function FadeTriggeringTextSplatIn takes nothing returns nothing
    call TextSplatFadeIn(GetTriggeringTextSplat(), 5.00, 0.20, "FadeTriggeringTextSplatOut")
endfunction

function FadeTriggeringTextSplatOut takes nothing returns nothing
    call TextSplatFadeOut(GetTriggeringTextSplat(), 5.00, 0.20, "FadeTriggeringTextSplatIn")
endfunction

function Trig_Text_Splats_Actions takes nothing returns nothing
    local integer white = 0
    local integer mono = 0
    call TextSplatInitializeCache()

    // don't create too many text splats in a row, we're close to the call limit when there are long texts
    set mono = TextSplatCreateMono("Super Mario Campaign", 0.0, 0.0, "Trebuchet", 18, TS_ALIGN_TOP(), TS_ALIGN_CENTER(), CreateColorInteger(255, 255, 0, 255))
    
    call TextSplatFadeIn(white, 5.00, 0.20, "FadeTriggeringTextSplatOut")
    call TextSplatEnableRunningText(white, 1, 0, 0.10)
    call TextSplatFloat(white, 0.00, 0.10, function Movement45Sin10, function Movement9Sin100, "")

    call TextSplatFloat(mono, 0.00, 0.10, function Movement9Sin100, function Movement9Sin100, "")
endfunction

function InitTrig_TextSplats takes nothing returns nothing
  set gg_trg_TextSplats = CreateTrigger()
  call TriggerRegisterTimerEventSingle(gg_trg_TextSplats, 0.00)
  call TriggerAddAction(gg_trg_TextSplats, function Trig_Text_Splats_Actions)
endfunction


This is my current code, I've removed all I found that was about Gradient TextSplat (Different colors in same text), if you see some unnecessary lines that I do not need, please do tell me or just post the code as it should be. Now, for my problem. At the moment all the code does is too "Create" a text which says "Super Mario Campaign", then that text starts patrolling back and forth to the northeast, what I want is that it should start moving straight north and never come back. Any help would be greatly appreciated, thanks in advance.

P.S. I also wonder how to add a wait in the above code, like create a text, move it north, wait two seconds THEN create next text. Thanks in advance.