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 > text in 3d...

#139283 - FireSlash - Tue Sep 04, 2007 6:08 am

I've tossed around some ideas and implementations, most have either failed, or fell short in some way, so I'm asking the rest of you: How do you get text on the 3d screen?

Situation: I've got a top screen in 3d that displays a greater part of the gameplay. It needs to show some text in two areas, ideally in different fonts.

Requirements: Basic A-z 0-9. etc; doesn't need to be fancy unicode or anything.

I was looking at bitmap based fonts, but I've yet to see an implementation that could be readily and quickly done without libs and functions that don't exist on the ds (OGL display lists, GLUT, GLAUX, etc)

I was thinking of a more dumbed down bitmap font routine, but then I'd have to create a disgusting and slow switch to handle all 2*26+10 letters I need.

More than anything, I'm interested to see how other people did it. I realize I could burn an extra vram bank and use 2D sprites, but I'd rather have the extra texture slot :)
_________________
FireSlash.net

#139301 - nce - Tue Sep 04, 2007 11:27 am

FireSlash wrote:

More than anything, I'm interested to see how other people did it. I realize I could burn an extra vram bank and use 2D sprites, but I'd rather have the extra texture slot :)


That's exactly the solution I've chosen. I'm using sprite on top of the main screen to desplaying text and menu. As I don't wanted to loose any texture space for that, I'm using the bank E for main sprite ( 64Ko si enough for some sprite in 256 colors )
and bank F for texture palette ( 16Ko is not much but as all textures are in 16 or 4 colors that's enough for me )

of course if you are using libnds, you'll need to rewrite a part of the code as it's using the bank E by default for texture palette ;)
_________________
-jerome-

#139321 - thegamefreak0134 - Tue Sep 04, 2007 6:06 pm

My personal recommendation is to use one of the modes that will allow you 3D on one background, and an extended rotation on the other. then use the second for a tile-based text engine. You could easily swap out "fonts" using tile RAM like any other thing. Of course, the drawback here is that you're basically limited to fixed-width fonts. That would be very quick to implement though.

We plan to use that approach, although more for debug info than anything else. Of course, sprites give you some extra functionality, but you might also consider using quads in 3D, if you're not tight on texture memory.

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]