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 Misc > How to create speech bubbles

#175746 - MichaelMossman - Thu Jan 27, 2011 8:20 pm

I realise that you cannot create text on a background by using the print function.

However, how do games, such as Prof Layton create dialog, using speech bubbles ?

I'm not looking for a coding solution here (although a demo would be a nice bonus). I would just like someone to explain the concept of how to do it.

#175750 - Dwedit - Fri Jan 28, 2011 3:04 am

It's done the same way any other GBA game does variable-width text.
You set aside an area of VRAM for a text box, and you draw text characters into the tiles with a sprite routine.
Tonc's Text Engine shows an example. (long article, intended for the GBA, but a NDS can do everything a GBA does.)

Then you draw the speech bubble just like any other drawing. Make the box or circle, maybe give it an outline, maybe shade it. Some people like to use a simple right triangle along with a rectangle.

On the DS, you could use a real bitmap mode instead of a tile mode if you prefer the eaiser way of accessing the pixels, but using tiled video modes makes the most efficient use of video ram.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#175753 - MichaelMossman - Fri Jan 28, 2011 11:55 am

Thanks a lot. I sort of thought that was probably the way to do it.

Maybe I was just hoping for a shortcut ?

Anyway, now you have confirmed the method, I can get down to the hard work of making it happen.