[rgss3] bitmap.draw_text and slicing text/line breaks

In relation to this script: https://forums.rpgmakerweb.com/index.php?threads/show-text-in-a-special-way.40599/

I was previously working with a hack solution of just adding various :text arguments, each with their own y values, to fake the look of different lines. But it's a chore and doesn't allow for much flexibility with different font sizes and all that. How would someone go about detecting \n in :text, adjusting/creating new lines whenever that's detected, and then drawing it? I don't mind having to make the bitmap height and width a set number rather than the exact width and height needed per message, if that's needed.

I found some forum threads talking about slicing text but I think it's for RGSS/XP ?
https://forum.chaos-project.com/index.php/topic,12867.msg173812.html#msg173812

Also, found this script for XP that has a similar purpose to Ossra's and seems to recognize line breaks within script calls. https://liferpgmaker.forumeiros.com/t55-mensagem-na-tela-estilo-mu

Sorry if this makes no sense. Completely lost here...
Is the purpose to have text show up in the background? Couldn't you just use a window with the opacity set to 0 and the z value set to something just above parallax?

Alternatively, if you need to use a bitmap, you could look into how text is drawn in Window Base and copy that. The Window sets up a 'contents' bitmap, which is used to draw all the text. Take a look at 'draw_text_ex' and all the methods called from there.
For the record, that script snippet I posted should work in VXA.
I was previously working with a hack solution of just adding various :text arguments, each with their own y values, to fake the look of different lines. But it's a chore and doesn't allow for much flexibility with different font sizes and all that.
I'm going to point out that the engine's default text drawing method DOESN'T adjust for different font heights. It basically does what you've been doing and displays new lines by giving them a Y-value that is a set number of pixels below the last line.

In the case of VXAce, that value is 24. If you check the "line_height" method, it assumes each line is only 24 pixels high and assigns each the Y of each new line to be this distance below the previous, regardless of how high the font is.

It does have a method to calculate the lengthwise width of a line, which is "text_size", but it is a rather CPU expensive method to use.
Is the purpose to have text show up in the background? Couldn't you just use a window with the opacity set to 0 and the z value set to something just above parallax?

Alternatively, if you need to use a bitmap, you could look into how text is drawn in Window Base and copy that. The Window sets up a 'contents' bitmap, which is used to draw all the text. Take a look at 'draw_text_ex' and all the methods called from there.

It's not for the background, no. I'm using this script for random segments in the game, paired with animation easing methods and picture-specific effects. I know I could technically just type the text onto a transparent image file and use that; I'd really rather avoid that since my project is text-heavy.

Original thread: https://forums.rpgmakerweb.com/threads/rgss3-bitmap-draw_text-and-slicing-text-line-breaks.117335/