Create beautiful UIs for the terminal

~ Home ~

RuTui 0.4 - better TUI for Ruby

In July 2012 i created RuTui out of frustration on missing TUI (Text User Interface) librarys for Ruby. Indeed there is curses but it is kind of limited when it comes to colors and other personalisations. So something had to be done. My focus on the project was flexibility and for sure colors <3, after a major update this afternoon i decided it is time to promote this project a little.

What is RuTui?

RuTui is a Ruby gem which makes it incredibly easy to create terminal based user interfaces (TUIs). It is developed with ansi escaping standards and support for 256 colors in mind, this means there is a strict limitation on which terminals this works. It works on the most linux desktop terminals, it is not proper colored on tty and for sure wont work on cmd.exe. But bringing and testing this lib to more plattforms including Windows and MacOSX is part of my future plans for this gem. push requests for sure are welcome too.

Edit// it now works in cmd.exe (even colors through ansicon)

Take a look how a output of the RuTui logo can look like:

In this example i used an own "image" format and a FIGlet Font called colossal

But it can do a lot more, there are sortable Tables, varius Shapes, Textfields, Themes, a straight forward ScreenManager, even animated Sprites. Basicly you have everything you need to create an user interface for any terminal app. If this still is not enough for you, read on.

Flexibility planned in

If you read trough the source you will see everything is kept very simple and basic. Its a nifty OO structure which is easily extensible. Each object is based on the BaseObject which provides the default structure that elements need to be able to be drawn from the screen. The object itself is an array with following structure:

@obj = [
    [Pixel.random, Pixel.random, Pixel.random]
    [Pixel.random, Pixel.random, Pixel.random]

A pixel is a simple object that consists of foreground & background -color and a single char. So all your own objects would have to provide is a array with row-arrays filled with pixels and for sure their position as X & Y coordinates, the rest gets done by the screen object itself.

Check it out

You can easily try it out with installing the gem with

sudo gem install rutui
get started with the wiki and the examples on GitHub.

Written: 12.10.2013
Keywords: tui, rutui, ruby, user interface, ui, project

Latest thoughts

12.03.2017   Nationality: Austria, but...

01.03.2017   One month in Bangkok

01.03.2017   Culture Shock in Cambodia

All those thoughts

About me

My name is Roman Pramberger, i am a 20something years old developer from Austria, spending my youth in Bern, Switzerland. I spend my days creating *things.

Get in touch over , , , or email with [name]@[surname].ch