Text-only window library for LOVE?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
FredMSloniker
Prole
Posts: 6
Joined: Fri Nov 02, 2018 10:08 pm

Text-only window library for LOVE?

Post by FredMSloniker » 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:
  • 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.)
All of these are things that a DOS window can do. Is there a LOVE library, third-party or otherwise, that would let me do these things, or would I have to roll my own?

User avatar
pgimeno
Party member
Posts: 1343
Joined: Sun Oct 18, 2015 2:58 pm

Re: Text-only window library for LOVE?

Post by pgimeno » Fri Nov 09, 2018 7:09 pm

Doesn't sound like you need LÖVE at all, just Lua (JIT or not, depending on what that thing uses).

This may help: https://github.com/kikito/ansicolors.lua but it says colours don't work on Windows, so if you're on Windows, maybe this other one does: https://gist.github.com/mlocati/fdabcae ... 712db24011
Thrust II Reloaded - GifLoad for Löve - GSpöt GUI - My NotABug.org repositories - portland (mobile orientation)
The MS-Github repositories I had have been closed after the acquisition announcement and will be removed in the near future.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests