03-16-2003, 10:17 PM | #1 |
Member
Join Date: Feb 2003
Posts: 46
|
To keep it simple, does anyone here know of, and where to get, a Java package, or even just a single class that provides ANSI tag support for transfer over a socket, obviously for the use of colour support in a Java coded MUD(or any telnetable server really)? I'm quite confident it is out there, as java MUDclients have been made that supports ANSI interpretation, and others have made MUDs in Java, and I would assume that at least a few of them have colour support. So my question is, where can i get my hands on it?
|
03-17-2003, 06:34 AM | #2 |
Posts: n/a
|
|
03-17-2003, 02:18 PM | #3 |
Member
Join Date: Feb 2003
Posts: 46
|
|
04-10-2005, 08:53 PM | #4 |
New Member
Join Date: Dec 2004
Posts: 25
|
I'm working on using ANSI color with Java too, but I'm not quite sure if I'm doing it right...would this, for example, be a correct string?
"\033[0;34m Bla bla blah..." I was also wondering if anyone could tell me how to test this? (I'm planning on starting a MUD, but I, er, haven't yet so I don't yet have a server with which to test it.) Thanks, Jaregarde |
04-11-2005, 01:11 AM | #5 |
New Member
Join Date: Feb 2005
Posts: 7
|
Here's a little piece of code I wrote in 2001, you're welcome to use it. You also might be able to include the .jar's from some other project in your classpath, and reuse their classes...
Thedia public final class ANSI { public static final String SANE = "\u001B[0m"; public static final String HIGH_INTENSITY = "\u001B[1m"; public static final String LOW_INTESITY = "\u001B[2m"; public static final String ITALIC = "\u001B[3m"; public static final String UNDERLINE = "\u001B[4m"; public static final String BLINK = "\u001B[5m"; public static final String RAPID_BLINK = "\u001B[6m"; public static final String REVERSE_VIDEO = "\u001B[7m"; public static final String INVISIBLE_TEXT = "\u001B[8m"; public static final String BLACK = "\u001B[30m"; public static final String RED = "\u001B[31m"; public static final String GREEN = "\u001B[32m"; public static final String YELLOW = "\u001B[33m"; public static final String BLUE = "\u001B[34m"; public static final String MAGENTA = "\u001B[35m"; public static final String CYAN = "\u001B[36m"; public static final String WHITE = "\u001B[37m"; public static final String BACKGROUND_BLACK = "\u001B[40m"; public static final String BACKGROUND_RED = "\u001B[41m"; public static final String BACKGROUND_GREEN = "\u001B[42m"; public static final String BACKGROUND_YELLOW = "\u001B[43m"; public static final String BACKGROUND_BLUE = "\u001B[44m"; public static final String BACKGROUND_MAGENTA = "\u001B[45m"; public static final String BACKGROUND_CYAN = "\u001B[46m"; public static final String BACKGROUND_WHITE = "\u001B[47m"; private ANSI() {} // disable automatic constructor } |
04-11-2005, 12:11 PM | #6 |
New Member
Join Date: Dec 2004
Posts: 25
|
Ok, thank you, Milliway; I was wondering something else, too, though. What if you want to have parts of the string have different colors? Do you just insert a new tag whenever you want to change the color?
|
04-11-2005, 12:30 PM | #7 |
New Member
Join Date: Feb 2005
Posts: 7
|
out.println(ANSI.CYAN + "This is cyan" + ANSI.RED + ", and this is red.");
|
Java and ANSI - Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ANSI logon screen for Circle-based mud | Lazari | MUD Coding | 4 | 06-03-2006 11:22 AM |
A Java Problem | Almondine War | MUD Coding | 6 | 10-21-2004 11:17 PM |
Ansi art, or whatever its called | Enzo | Tavern of the Blue Hand | 3 | 08-21-2004 12:12 PM |
ANSI prompts at initial login: good or bad? | erdos | Advanced MUD Concepts | 9 | 01-10-2004 08:11 PM |
ANSI Colors in muds | markizs | Tavern of the Blue Hand | 9 | 04-10-2003 02:09 AM |
|
|