GRRLIB help

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

Nov 11, 2009

GRRLIB help by diego_pmc at 6:39 PM (867 Views / 0 Likes) 3 replies

  1. diego_pmc
    OP

    Newcomer diego_pmc Advanced Member

    Joined:
    Sep 8, 2009
    Messages:
    52
    Country:
    United States
    I have some questions about GRRLIB_Printf():

    • How can I use one of the default fonts? For example, when I use the standard Printf(), the font used is Lucida Console; how can I use this in GRRLIB_Printf()?
    • How can I make GRRLIB_Printf() print the text after the text that is already present on the screen? In other words, if here already is some text present on the screen, how can I make GRRLIB_Printf() know which are the x and y coordinates it should use to print the piece of text I give it?
     
  2. usptactical

    Member usptactical GBAtemp Fan

    Joined:
    Apr 7, 2009
    Messages:
    317
    Country:
    United States
    You have to create a tilemap image of the font - WiiBuilder can do this for you. There's also a width limit on the image (1024, if I recall) so depending on font size chosen, you need to split that into 2 (or more) lines. It might be easier for you to just use FreeTypeGX instead.

    If you want to print after that line, you need to keep track of the total width/height of the previous word/line based on the sum of it's tiles.
     
  3. diego_pmc
    OP

    Newcomer diego_pmc Advanced Member

    Joined:
    Sep 8, 2009
    Messages:
    52
    Country:
    United States
    Aha, thanks. [​IMG]
    I want to ask another question: where can I get RGBA color codes that I can use with the GRRLIB functions? I've Googled (of course) but was not able to find any table that would give the the RGBA codes in the same format as the ones used in Sand Traps, for example, a game that also uses GRRLIB (e.g.: 0x0f0c03FF).
     
  4. usptactical

    Member usptactical GBAtemp Fan

    Joined:
    Apr 7, 2009
    Messages:
    317
    Country:
    United States
    The colors are just basic hex codes plus alpha stored in a u32:

    0xRRGGBBAA -> Red Green Blue Alpha

    so 0x0f0c03FF would be Red 15 Green 12 Blue 3 Alpha 255
     

Share This Page