Jump to content
  • Advertisement
Sign in to follow this  
FRex

BLuaConsole

This topic is 1514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As can be guessed this is a Lua console named "BLuaConsole". It's under MIT license, just as Lua.

It uses SFML 2.1 for input and rendering but is portable (because the core is only using Lua 5.[12] API) to any other font rendering / key input very easily, this was inspired by way GWEN handles it's renderers and inputs.

 

The code, API and example (from which screen below comes) are all well commented.

It uses only C++98 features and compiles with W, Wall, ansi and pedantic with no errors at all on GCC so I assume it should work with Visual but I can't test it.

 

It's also usable for both Lua 5.1 and 5.2 (I compile it both with LuaJIT and 5.2 before every commit).

 

GitHub link: https://github.com/FRex/LuaConsole

 

The list of features is very standard and exactly what you'd expect of a "terminal":

  • history (up/down),
  • completion and hinting (tab),
  • colored output (with setable colors for errors, (default) echos, frame, title, background, code, hints, you can also echo a string with each character having a specific color),
  • repeating last line when pressing enter with empty prompt (gdb inspired, toggleable),
  • standard movement and editing (typing, backspace, delete, left/right),
  • jumping over words for quicker navigation (ctrl + left/right),
  • many, many more.

 

A teaser screen (that doesn't say much).

23kf0ir.png

Share this post


Link to post
Share on other sites
Advertisement

I am interested in all Lua things, so first thanks for that announcement :) Could you explain a little what one can do with such a console? Is it for evaluating short Lua expressions only, or are there other usecases?

Share this post


Link to post
Share on other sites

It's a Lua terminal that you can use in game (for now, just in SFML ones but SDL should be 100% usable if you get a monospaced font renderer).

I wrote it for myself to use it like a 'dev console'. To print errors to, write commands, edit maps with commands, etc.

You can enter long expressions too BTW, line by line, there is chunking just like in standalone Lua.

There are no other 'usecases', all of the features are just icing to help you easily and quickly enter small bits of Lua (you can of course call dofile, require or write a long function that takes 20 lines).

Two most important features (for me) are completion and history, it's much quicker (at least for me) to use history and complete most of the code (or even see what you can access in which table/metatable) than to type every-single-letter into some primitive ad-hoc prompt.

The completion is rather good (but not perfect), it'll try to look through metatable and table of last object in prompt line, it'll skip elements starting with _ unless you already typed _ and if there is 0 ambiguity it'll complete the code instead of printing the hint (green text in screen above is hints, it's really hard to show what it is on static screens).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!