Thread: TextTag
View Single Post
Old 08-11-2008, 03:38 AM   #2
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I think you're missing some configurations there... I would do this:
Collapse JASS:
globals    
    // for custom centered texttags
    private constant real MEAN_CHAR_WIDTH = 5.5
    private constant real MAX_TEXT_SHIFT = 200.0
    private constant real DEFAULT_HEIGHT = 16.0

    // for default texttags
    private constant real   SIGN_SHIFT = 16.0
    private constant real   FONT_SIZE = 0.024
    private constant string MISS = "miss"
    private constant real   LIFESPAN = 4.00
    private constant real   FADEPOINT = 2.5
    private constant real   VELOCITY =0.04
    private constant real   VELOCITY_ANGLE = 0.0
endglobals

public function XY takes real x, real y, string text, string color returns nothing
    local texttag tt = CreateTextTag()
    local real shift = RMinBJ(StringLength(text)*MEAN_CHAR_WIDTH, MAX_TEXT_SHIFT)
    call SetTextTagText(tt, color+text, FONT_SIZE)
    call SetTextTagPos(tt, x-shift, y, DEFAULT_HEIGHT)
    call SetTextTagVelocity(tt, VELOCITY_ANGLE, VELOCITY)
    call SetTextTagVisibility(tt, true)
    call SetTextTagFadepoint(tt, FADEPOINT)
    call SetTextTagLifespan(tt, LIFESPAN)
    call SetTextTagPermanent(tt, false)
    set tt = null
endfunction

public function XYCustom takes real x, real y, string text, string color, real size, real height, real velocityangle, real velocity, real lifespan, real fadepoint returns nothing
    local texttag tt = CreateTextTag()
    local real shift = RMinBJ(StringLength(text)*MEAN_CHAR_WIDTH, MAX_TEXT_SHIFT)
    call SetTextTagText(tt, color+text, size)
    call SetTextTagPos(tt, x-shift, y, height)
    call SetTextTagVelocity(tt, velocityangle, angle)
    call SetTextTagVisibility(tt, true)
    call SetTextTagFadepoint(tt, fadepoint)
    call SetTextTagLifespan(tt, lifespan)
    call SetTextTagPermanent(tt, false)
    set tt = null
endfunction

//The same for Unit texttags
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote