Printing colored text

Discussion in 'Wii - Emulation and Homebrew' started by diego_pmc, Nov 22, 2009.

Nov 22, 2009

Printing colored text by diego_pmc at 9:17 AM (635 Views / 0 Likes) 4 replies

  1. diego_pmc
    OP

    Newcomer diego_pmc Advanced Member

    Joined:
    Sep 8, 2009
    Messages:
    52
    Country:
    United States
    I would like to know if there's any way to print colored text in Wii Homebrew applications, without using one of the third-party graphics libraries. Thanks!
     
  2. Det1re

    Member Det1re det1re.de

    Joined:
    Oct 28, 2008
    Messages:
    1,272
    Location:
    Germany
    Country:
    Germany
    Code:
    // implementation by WiiPower
    printf("\x1b[%u;%um", 47, false);
    printf("\x1b[%u;%um", 30, false);
    Where the numbers represent the colors.
    Those beginning with 4 are for the background, those with 3 are text/foreground.

    So in this example we would have a white background with black text. For other colors see ANSI escape codes @ wikipedia.
     
  3. pembo

    Member pembo GBAtemp Regular

    Joined:
    Jun 1, 2009
    Messages:
    105
    Country:
    United Kingdom
    I put a sample project together with generated documentation from the bootmii configuration editor source code to do these sorts of things
    Download

    it's a little more complex as this example demonstrates the use of the console skins that I used in BCE. You should download and take a look at the code.

    You'll be most interested in the console class.
     
  4. diego_pmc
    OP

    Newcomer diego_pmc Advanced Member

    Joined:
    Sep 8, 2009
    Messages:
    52
    Country:
    United States
    Thank you! There are some other things in your code that might be useful for me. BTW, pembo, how do you produce those documentation pages?
     
  5. pembo

    Member pembo GBAtemp Regular

    Joined:
    Jun 1, 2009
    Messages:
    105
    Country:
    United Kingdom
    your welcome - that's why I put this stuff together in the first place after going through the pains building the bootmii config editor [​IMG]

    The documentation is generated by a program called doxygen. http://www.doxygen.org/
     

Share This Page