Jump to content

  • Log In with Google      Sign In   
  • Create Account

Oh my glorious code!

  • You cannot reply to this topic
21 replies to this topic

#21 Sik_the_hedgehog   Crossbones+   -  Reputation: 1833

Like
0Likes
Like

Posted 11 August 2013 - 11:02 PM

Not necessarily. What I meant was doing some minimal coloring of whatever you're outputting, without taking over the entire console

 

That's exactly what I meant... =P


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

Sponsor:

#22 BGB   Crossbones+   -  Reputation: 1554

Like
0Likes
Like

Posted 12 August 2013 - 09:23 AM

If stdout supports ANSI escape codes (e.g. the terminals on *nix or DOS with ANSI.SYS) you could use the escape codes for even more interesting stuff without moving away from the standard library. Colors everywhere!

 

ANSI codes are nifty...

 

FWIW, the console in my engine also supports them to some extent, though not to the level that allows a full UI (this currently requires hooking console events and drawing directly into the console buffer), thus leading to the funkiness of doing a DOS-style UI inside of a 3D engine (I actually have an in-engine text editor with a vaguely similar color scheme and style to QBasic and MS Edit, though actually a little worse as it partly handles most non-trivial commands VI-style...).

 

as-is, it would require some tweaks to the console, and probably something analogous to stdout/stdin, such as to allow "programs" the ability to receive user-input (beyond generally being one-off console commands). at that rate, it would almost be worthwhile to throw together a little logic to allow console-commands to trigger loading/executing self-contained script files.

 

say something like:

function main(argv:string[]):void
{
    var s:string;
    var a:string[];
    stdout.printf("Greets!\n");
    while(!stdin.feof())
    {
        s=stdin.gets();
        a=s.split();
        if(a[0]=="north")
            { ... }
        ...
    }
}

I once considered possibly supporting render-to-texture with consoles, say to allow consoles to be textured onto in-game objects, but never did much with this.


Edited by cr88192, 12 August 2013 - 09:24 AM.






PARTNERS