Page 1 of 1

(done) dsb_textformat && dsb_bitmap_textout

Posted: Fri Mar 13, 2009 2:16 pm
by ian_scho
Not sure if it's worth Sophia's time on this one...

Code: Select all

	dsb_textformat(chars_per_line, y_offset_per_line, max_lines)
	dsb_bitmap_textout(bitmap, font, string, x, y, alignment, color)
The above assigns a format to our textout, then paints our text onto a bitmap. If we pass alignment as MULTILINE it get's interesting as we can have long sausages of text automatically sliced and diced for us using the chars_per_line value.

Great. But, I'd like the user to read a paragraph, click, read the next paragraph painted on the same canvas. I don't know how far 'down' I am on the canvas, unless I boot up the app a couple of times and change the x value accordingly for each paragraph. The dsb_bitmap_textout returns no height offset value or anything so does anyone have a better suggestion than trial and error or pen&paper math.

Re: dsb_textformat && dsb_bitmap_textout

Posted: Fri Mar 13, 2009 7:48 pm
by Sophia
It would not be a big problem to make dsb_bitmap_textout return the number of lines printed. Since you know "y_offset_per_line," it then becomes trivial to compute where the next set of lines would go.

Re: (done) dsb_textformat && dsb_bitmap_textout

Posted: Sat Mar 14, 2009 3:38 pm
by ian_scho
Thanks! I'm in no hurry... Ahh, I've just read the DSB 0.36 thread :)))