The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

clgui

Started by Juju, November 05, 2015, 08:18:28 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Juju

So I was messing with Ruby today and I did this. It's a Command-Line Graphic User Interface library. As in, it takes a text-only VT100 emulator such as your Linux terminal and turns it into a thing you can draw on, thanks to Unicode Braille characters. It have some drawing functions such as pxl_on, pxl_off, pxl_change, line and many others. Not complete yet but it's a good start. :P

Download the source here: https://github.com/juju2143/clgui
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

DJ Omnimaga

is there a demo somewhere to try to see how it looks like or is it looking like most command line interfaces out there? I notice some drawing commands, but I am unfamiliar with graphical command line interfaces.

Juju

Yeah it's kind of hard to explain, if you've got Ruby and know how to install a gem you can always try the example out (not sure it works on Windows though, maybe Cygwin), it's basically a dot drawn with Braille characters moving around with the arrow keys. It allows for 8 dots per character this way, it's kind of like this thing I did once:
⣇⣀⡇⡠⠤⡀⠈⡇⠀⠈⡇⠀⡠⠤⡀
⠇⠀⠇⠫⠭⠁⠠⠧⠀⠠⠧⠀⠣⠤⠃
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

DJ Omnimaga

Oh I see now, it uses braille. So I assume that it makes it easier for people to do pixel-art-oriented games in command prompt? (Eg like old text RPGs but more graphical)

Streetwalrus

Yeah basically that, with higher resolution, the only problem is that color resolution is unchanged (you can only color whole characters, not individual dots). Libcaca might be a lot more interesting for that kind of stuff. MPV supports outputting with it, it's pretty funny.
Still a fun thing to do Juju, nice job on this. I've mentioned this on IRC already, z80e uses the same trick to emulate a calculator display in a terminal without the need for any graphics library.

DJ Omnimaga

Wait, I didn't know z80e did that. Is it faster that way or is it just for the convenience of not having to use graphics library? And what if the user wants to setup the display to 1x size? Is that possible?


Back on topic, I am curious if any game could be made out of this program Juju.

Streetwalrus

Quote from: DJ Omnimaga on November 15, 2015, 06:27:59 am
Wait, I didn't know z80e did that. Is it faster that way or is it just for the convenience of not having to use graphics library? And what if the user wants to setup the display to 1x size? Is that possible?

The latter, and you can't have any scaling with that method other than changing the terminal font size.

DJ Omnimaga

Hmm that might be problematic when people start using 19 inch monitors at 4k resolutions, then the display will be very small. Hopefully changing the terminal font size will allow decent scaling. (I know that when changing the size of some fonts, they don't scale evenly in each direction)

Streetwalrus

Well when you use high resolutions, the OS is supposed to compensate by enlarging the fonts so that the physical size of the characters remains the same. See phones where they keep increasing the pixel density, yet it remains readable (the microcat subforum font is actually more readable on my phone than my computer because of that).

DJ Omnimaga

Not really. On XP and 7 you need to go in your settings and change the font size yourself. In browsers, you need to use CTRL+ +/- to resize page content and stuff.

Streetwalrus

Well XP and 7 existed before high density displays so they're not aware of that.

DJ Omnimaga

Yeah true. Back then, people cared about having as much content as possible in the screen than being able to click stuff easily.

alexgt

Quote from: DJ Omnimaga on November 16, 2015, 10:18:06 pm
Yeah true. Back then, people cared about having as much content as possible in the screen than being able to click stuff easily.

I still want more stuff on my screen when I have a mouse because it is just more convenient but on touch screens I like bigger objects.

Streetwalrus

I also like to have content over visibility. I have my phone set up to think the screen is larger than it is, because honestly Android is made for blind people. <_<

alexgt

Yeah, no kidding it is a problem on the Prime kinda since the touch screen is not the best but it is still really responsive. The smallest button I would make is 10x10.

Powered by EzPortal