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.

DS development > Mixing text and Graphics

#171349 - MichaelMossman - Sun Nov 15, 2009 4:19 pm

I have spent hours (days ?) scouring the internet for tutorials and examples but I still can't solve a seemingly simple little problem.

I want to write some text to a specific part of the screen over the top of a simple graphic ( a square).

I now know how to create BG modes, use 3d graphics and handle complicated tiles and sprites (well, at least I have read plenty of tutorials on these subjects ! ) but I still can't find the solution to my problem.

Basically, all I want to do is to draw a square on both screens (in any mode) and then write some text to it.

Have I missed something really basic or is this more difficult than I thought.

Please help, Mike

#171355 - Azenris - Sun Nov 15, 2009 9:33 pm

There is no special built in function for text, you'll have to create some sort of manager to do it for you. There are different ways of doing it. You could use sprites to hold each character of the text or have the characters place into the background. You can use priorities to make sure the text is on top of whatever you need.

There is others ways of doing it but those are the most simple, fixed-width ways. http://www.coranac.com/tonc/text/text.htm gives an idea of it all
_________________
My Homebrew Games

#171359 - Drovor - Mon Nov 16, 2009 3:15 am

Text over background graphics is one of the examples

examples/ds/Graphics/3D/Mixed_Text_3D

#171371 - MichaelMossman - Mon Nov 16, 2009 5:12 pm

Thanks, Azenris, that's given me plenty to mug up on !

Drover, I followed your link but couldn't find a way to get to the example you quoted. Can you please give me a full link to the example.

Thanks, Mike

#171377 - Drovor - Mon Nov 16, 2009 7:59 pm

The NDS examples from the devkitPro sourceforge page:
http://sourceforge.net/projects/devkitpro/files/examples/nds/