+ Reply to Thread
Results 1 to 5 of 5

Thread: String.Format Align

  1. #1
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default String.Format Align

    Hi guys having an issue with string.format not counting correctly

    Code:
    Text = String("%0s%-44s\t%0s\n", Text, Unit.Abilities[v.Ability].Tooltip, v.Total)
    I have specified 44 characters (Space filled), However it keeps mis counting, Ive also tried the string:len() approach and still i get this:

    http://i60.tinypic.com/154hdmb.png

  2. #2
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    I am not sure what you mean by "keeps counting".

    Note that %10s means "pad to 10", but does not mean "truncate to 10". That'd be "%.10s" for truncate, or "%10.10s" for truncate-or-pad.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  3. #3
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Well I want 44 characters total (space filled), then some more text.

    Iv'e specified %-44s (44 chars left aligned), If you notice the screen shot im not getting 44 total for: Electricity Blast (Air).

    You can see its less spaced than the rest, meaning something is mis counting/not applying 44 char limit (space filled).
    You can also see the rest of the text is correctly aligned with the same string pattern.
    Last edited by Ferather; 10-28-2014 at 11:15 AM.

  4. #4
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Nvm ive done some string:len() dumping, padding is correct, its the font/character size.

  5. #5
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Ahh, yes. Proportional fonts are sort of a pain for that kind of formatting.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts