#178420 - chickendude - Sat Jun 13, 2015 7:33 pm
I've been thinking about this for a while now and i can't quite come up with a good solution. Currently my text is drawn as 8x8 tiles (i believe i've seen some things which appear to be 6x8? That would look much better, but i can't think of a way to pull that off) in one background and the text box is drawn on another background with a higher priority (drawn behind the font background). However, today i came across an issue with that when trying to add a popup box:
http://www.mirari.fr/GmqC (i guess i can't post an image, so here's a link to the image)
Since the popup box is getting drawn to the same background as the other text box, it obviously is overwriting that space so the transparent corners show the background. I also shifted the text bg layer 4 pixels down and to the right so that it'd hug nicely to the frame of the box, but you can see the text shows through on the top border and there's an extra space on the bottom border where you should be able to see the text.
A few ways that i can see to get around this are:
1. Use the other two backgrounds as a top layer that get drawn over top of the current background.
2. Draw the border as sprites. This seems like a bit of a pain to do, but then i wouldn't have to waste the other two borders.
3. Use a bitmap mode.
How are text boxes and text normally drawn in games? Most games seem to use unaligned/variable width text, but i can't imagine doing that with sprites (there's likely not enough sprite memory to display a full screen of text anyway). I might just have to reorganize things to prevent boxes from getting drawn over top of each other.
(EDIT: Sorry for the ugly colors/font, i'm just trying to get things working first)
http://www.mirari.fr/GmqC (i guess i can't post an image, so here's a link to the image)
Since the popup box is getting drawn to the same background as the other text box, it obviously is overwriting that space so the transparent corners show the background. I also shifted the text bg layer 4 pixels down and to the right so that it'd hug nicely to the frame of the box, but you can see the text shows through on the top border and there's an extra space on the bottom border where you should be able to see the text.
A few ways that i can see to get around this are:
1. Use the other two backgrounds as a top layer that get drawn over top of the current background.
2. Draw the border as sprites. This seems like a bit of a pain to do, but then i wouldn't have to waste the other two borders.
3. Use a bitmap mode.
How are text boxes and text normally drawn in games? Most games seem to use unaligned/variable width text, but i can't imagine doing that with sprites (there's likely not enough sprite memory to display a full screen of text anyway). I might just have to reorganize things to prevent boxes from getting drawn over top of each other.
(EDIT: Sorry for the ugly colors/font, i'm just trying to get things working first)