1
Programming / Re: BearLibTerminal: a pseudo-terminal window library for roguelike
« on: October 06, 2018, 10:24:17 PM »
Contrary to how it may look, I am not dead, yet =|.
However, if you want to literally continue printing, i. e. from the place of the last output symbol, there is no exact way. But I think there is no need. You can just concatenate the strings and print them in one go.
See terminal_print reference.
Quote from: BrodyDuderson
What is the best way to start printing where the last print left off?If you want to print phrase by phrase (actually more like paragraph by paragraph), then it is easy to do with measuring. Just remember that dimensions_t returned from print/measure is a size, not coordinates, so you have to add it to the last printing position. Note that print function also returns dimensions_t, you do not need a separate measure call if you've already printed the text.
However, if you want to literally continue printing, i. e. from the place of the last output symbol, there is no exact way. But I think there is no need. You can just concatenate the strings and print them in one go.
Quote from: BrodyDuderson
Say I wanted to change the color of one of the words in awesomeText to a custom color (activeTheme->crazyColor). What would be the best way to do it?You can use some formatting tags in the string, e. g.
Code: [Select]
terminal_printf(x, y, "Some text with a [color=%d]word[/color] in another color", crazyColor); // choose %d or %s depending on the way you store the color (color_t or char*)
See terminal_print reference.