CodeWalrus

Development => PC, Mac & Vintage Computers => Topic started by: Yuki on November 05, 2015, 08:18:28 AM

Title: clgui
Post by: Yuki on November 05, 2015, 08:18:28 AM
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
Title: Re: clgui
Post by: Dream of Omnimaga on November 05, 2015, 08:22:10 AM
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.
Title: Re: clgui
Post by: Yuki on November 05, 2015, 08:47:42 AM
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:
⣇⣀⡇⡠⠤⡀⠈⡇⠀⠈⡇⠀⡠⠤⡀
⠇⠀⠇⠫⠭⠁⠠⠧⠀⠠⠧⠀⠣⠤⠃
Title: Re: clgui
Post by: Dream of Omnimaga on November 05, 2015, 09:37:38 AM
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)
Title: Re: clgui
Post by: novenary on November 05, 2015, 01:51:09 PM
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 (http://caca.zoy.org/wiki/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.
Title: Re: clgui
Post by: Dream of 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?


Back on topic, I am curious if any game could be made out of this program Juju.
Title: Re: clgui
Post by: novenary on November 15, 2015, 09:35:23 AM
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.
Title: Re: clgui
Post by: Dream of Omnimaga on November 16, 2015, 06:29:21 PM
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)
Title: Re: clgui
Post by: novenary on November 16, 2015, 07:59:51 PM
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).
Title: Re: clgui
Post by: Dream of Omnimaga on November 16, 2015, 10:15:22 PM
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.
Title: Re: clgui
Post by: novenary on November 16, 2015, 10:16:12 PM
Well XP and 7 existed before high density displays so they're not aware of that.
Title: Re: clgui
Post by: Dream of 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.
Title: Re: clgui
Post by: alexgt on November 17, 2015, 12:14:56 AM
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.
Title: Re: clgui
Post by: novenary on November 17, 2015, 09:13:19 AM
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. <_<
Title: Re: clgui
Post by: alexgt on November 17, 2015, 01:44:45 PM
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.
Title: Re: clgui
Post by: Dream of Omnimaga on November 19, 2015, 07:42:35 PM
I actually don't mind the Prime touchscreen. The text is small but you can resize it and at least we now have semi-smooth-scrolling (semi as in some lag occurs). We can't zoom in/out outside graphs and custom programs like mViewer, though.
Title: Re: clgui
Post by: alexgt on November 19, 2015, 08:19:18 PM
Yeah the Prime is great as far as how it functions but if you have your buttons too small then it is hard for the user to press them. On MinePrime the sweetspot was 16 pixels there was enough on the screen and it could be interacted with easily.
Title: Re: clgui
Post by: Dream of Omnimaga on December 03, 2015, 07:18:07 PM
Yeah true. That said even 16x16 is a bit small, as you don't see anything under your finger. For better precision it's better to use 32x32 or so, but sometimes that is not possible, especially for a tilemap game. In strategy games people just make the player select an area of the map and it selects all units in it.

Usually, the best for navigation is if it's possible to pinch-zoom in/out, though. But that doesn't look very professional if used inside a game.