Printing colored text

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

  1. diego_pmc
    OP

    diego_pmc Advanced Member

    Newcomer
    52
    0
    Sep 8, 2009
    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

    Det1re det1re.de

    Member
    1,272
    1
    Oct 28, 2008
    Gambia, The
    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

    pembo GBAtemp Regular

    Member
    105
    0
    Jun 1, 2009
    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

    diego_pmc Advanced Member

    Newcomer
    52
    0
    Sep 8, 2009
    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

    pembo GBAtemp Regular

    Member
    105
    0
    Jun 1, 2009
    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/