Results 1 to 2 of 2

Thread: Text formatting

  1. #1
    Lesser Wizard
    Join Date
    Nov 2010
    Location
    Los Angeles, California, United States, United States
    Posts
    126

    Default Text formatting

    Can you point me to an explanation of what formatting options are available with text rendering? I notice the "'7" for Bold. Are there other options?

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    The text formatting codes all change the color. Open the .txt file with the associated font to see what the colors and codes are.

    For instance, RTbareBones/media/interface/font_trajan.txt has this:

    Code:
    `format code specifications for inline font formatting (SANSI for those that remember the BBS days)
    
    //add_format_color|<character code>,r,g,b
    
    add_format_color|0|255, 255, 255|//default
    
    add_format_color|2|0, 160, 0|//dark green
    add_format_color|3|0, 160, 160|//dark cyan
    add_format_color|4|160, 0, 0|//dark red
    add_format_color|5|160, 0, 114|//dark purple
    add_format_color|6|150, 144, 0|//brown
    add_format_color|7|160, 160, 160|//gray
    add_format_color|8|132, 108, 70|//dark brown
    add_format_color|9|0, 0,255|//dark brown
    add_format_color|0|0, 255,0|//bright green
    add_format_color|!|0, 255,255|//bright cyan
    add_format_color|@|232, 0,0|//bright red
    add_format_color|#|232, 0,166|//bright purple
    add_format_color|$|255, 255,0|//bright yellow
    These are encoded into the .rtfont file when rtpack.exe builds in the update_media.bat. (btw I'll add something to the wiki about making new fonts if anybody ever needs it.. the font_trajan.bmfc file can be opened by BMFont, a free font tool, could be used as an example)

    So, example of doing some colors:

    GetFont(FONT_SMALL)->DrawScaled(0, 0, "white `2Green `3Cyan `4Red `5Purp ");

    Pro tip: doing `` will "undo" the last color change, they work like a stack, ie: "`2Green green green... `3Cyan! ``back to green".
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Customized Text
    By Fieldrin in forum Novashell Game Creation System
    Replies: 0
    Last Post: 02-25-2010, 09:33 AM
  2. IME for Clanlib Text Box
    By hazard in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 08-22-2009, 11:44 AM
  3. New Day Text
    By File Sponge in forum Funeral Quest
    Replies: 2
    Last Post: 08-29-2006, 05:30 AM
  4. New Day text
    By File Sponge in forum Funeral Quest
    Replies: 0
    Last Post: 10-16-2005, 11:13 PM
  5. Bug: Big text in TLM on laptop
    By mrbrown in forum Other RTsoft Games
    Replies: 5
    Last Post: 09-03-2002, 03:04 PM

Bookmarks

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
  •