gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Writing text as a bg map

#4539 - Psyk - Wed Apr 02, 2003 9:08 pm

How do i manipulate a background map so i can use it to write text? I already have the font and the background set up. How do i make it so i can specify actual text at run-time and not as a pre-built map? I don't need precise code as i will have to adapt it for my code anyway, i just need the basic jist of it.

#4540 - tepples - Wed Apr 02, 2003 9:36 pm

Psyk wrote:
How do i manipulate a background map so i can use it to write text? I already have the font and the background set up. How do i make it so i can specify actual text at run-time and not as a pre-built map? I don't need precise code as i will have to adapt it for my code anyway, i just need the basic jist of it.

Assume your font is 8x8 pixels per glyph and laid out in ASCII encoding, that is, tile 32 is a space, tile 65 is a glyph for 'A', etc. Then you can merely write the characters as tile indices.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.