Text-only window library for LOVE?
Posted: Fri Nov 09, 2018 6:49 pm
I want to re-implement Super Star Trek in LOVE. More precisely, I want to implement it in OpenComputers, a Lua-based mod for Minecraft that lets you build and program in-game computers, but I want to use LOVE as a shell to emulate the graphics capabilities of those computers for development purposes. (It's much more convenient to use Notepad++ than to type code in in-game.) To do so, one of the things I'll need is a LOVE library that emulates the OpenComputers graphics capabilities.
Which is to say, the text window. OpenComputers supports positioning the cursor, changing the foreground and background colors of the next text to be printed, and printing text using a fixed-width font. It also supports different screen resolutions, up to 160x50 characters. Looking at LOVE's text-handling capabilities, I note the following:
Which is to say, the text window. OpenComputers supports positioning the cursor, changing the foreground and background colors of the next text to be printed, and printing text using a fixed-width font. It also supports different screen resolutions, up to 160x50 characters. Looking at LOVE's text-handling capabilities, I note the following:
- I have to specify text positions by pixel. Ideally, I would be able to use rows and columns of characters; can I just multiply by getWidth(" ") and getHeight(), or is even a fixed-width font going to be weird in that regard?
- There's no concept of a cursor. You can't chain an arbitrary series of print functions together and have them print one after another. Similarly, there's no concept of scrolling text.
- There doesn't seem to be support for changing background colors. (To be clear, in OpenComputers I can set an individual background color for each character.)