Creates a new TextBuffer with the specified width and height.
Creates a new TextBufferWriter bound to this TextBuffer.
Converts this TextBuffer into a string.
Used to specify that a writer's width or height should use all the space it can.
Sets the height (number of lines) for this TextBuffer.
For now you'll have to explore the source (text.d) and have a look at the module-level unittests to see some testing examples.
When I can be bothered, I'll add user-facing examples :)
Limitations: Currently the buffer can only be resized vertically, not horizontally.
This is due to how the memory's laid out, resizing vertically requires a slightly more complicated algorithm that I'm too lazy to do right now.
Creating the final string output (via toString or toStringNoDupe) is unoptimised. It performs pretty well for a 180x180 buffer with a sparing amount of colours, but don't expect it to perform too well right now. One big issue is that *any* change will cause the entire output to be reconstructed, which I'm sure can be changed to be a bit more optimal.
An ANSI-enabled class used to easily manipulate a text buffer of a fixed width and height.
Description: This class was inspired by the GPU component from the OpenComputers Minecraft mod.
I thought having something like this, where you can easily manipulate a 2D grid of characters (including colour and the like) would be quite valuable.
For example, the existence of this class can be the stepping stone into various other things such as: a basic (and I mean basic) console-based UI functionality; other ANSI-enabled components such as tables which can otherwise be a pain due to the non-uniform length of ANSI text (e.g. ANSI codes being invisible characters), and so on.