| View previous topic :: View next topic |
| Author |
Message |
wont
Joined: 23 May 2008 Posts: 13
|
Posted: Sat May 31, 2008 5:46 am Post subject: Map symbols |
|
|
If I understood correctly, it is only possible to use a single character as a map symbol.
However, nowadays most (?) terminals use UTF-8, so it'd be really cool if it were possible to use a string instead of a character. This would make possible using Unicode line art (at least I think so).
http://en.wikipedia.org/wiki/Box_drawing_characters |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Sat May 31, 2008 9:26 am Post subject: |
|
|
#map set roomsymbol uses a string so color can be added as well.
#map legenda uses characters, not sure how well tintin deals with unicode though. |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Sat May 31, 2008 8:41 pm Post subject: |
|
|
I looked into it.
To enable UTF-8 on Linux (might only work on some terminals) you'd use: \e%G and \e%@ to return to Latin-1.
So to print the cent sign you'd use: #showme {\e%G\xC2\xA2\e%@}
It's easier to switch in and out of vt100 graphics mapping using \e(0 and \e(B to return to Latin-1.
For example:
#forall {0 1 2 3 4 5 6 7 8 9 A B C D E F} {#forall {0 1 2 3 4 5 6 7 8 9 A B C D E F} {#showme (&0&&9) \e(0\x&0&&0\e(B}}
But it tends to differ a lot between terminals.
Did you try the manual suggestion? #map flag vtgraphics and setting your legenda to: 250 223 222 200 220 186 201 204 221 188 205 202 187 185 203 206 246
The vtgraphics setting toggles the \e[12m code for drawing, and \e[10m to turn it off. |
|
| Back to top |
|
 |
wont
Joined: 23 May 2008 Posts: 13
|
Posted: Sun Jun 01, 2008 2:33 am Post subject: |
|
|
Excuse me, but I fail to understand.
Why should I set my terminal to UTF-8? It is always switched to it.
And yes, #showme {\e%G\xC2\xA2\e%@} works, but then #showme {\xC2\xA2} works equally well.
Your #forall command produces the usual printable ASCII and not much else (all the higher characters show as boxes or something weird, depending).
In contrast, #forall {8 9 A B} {#forall {0 1 2 3 4 5 6 7 8 9 A B C D E F} {#showme \xE2\x94\x&0&&0}} shows me a nice selection of weird line-art characters (not all there is).
As you can see, my preferred solution is accepting multibyte characters in legenda, not mucking around with terminal settings. |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Sun Jun 01, 2008 8:26 pm Post subject: |
|
|
| Alright. The legenda uses decimal values as the input rather than escape codes, but I'll see what I can do. |
|
| Back to top |
|
 |
wont
Joined: 23 May 2008 Posts: 13
|
Posted: Sun Jun 01, 2008 11:13 pm Post subject: |
|
|
For the user it'd be easiest if the user could just paste the symbols in, not write escape codes.
(currently it is possible to do #map color ╢. It looks and is buggy, but serves as a demonstration.) |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Mon Jun 02, 2008 10:32 am Post subject: |
|
|
Pasting shouldn't be an issue.
The following seems to do the trick for displaying UTF-8 box drawing characters:
#forall {9 A} {#forall {0 1 2 3 4 5 6 7 8 9 A B C D E F} {#showme \xE2\x95\x&0&&0}}
I'm not sure about the best character for a no exit room and the player character, and decent characters for the n e s w exits are lacking as well.
So far I came up with the following:
#map legenda ▪ █ █ ╚ █ ║ ╔ ╠ █ ╝ ═ ╩ ╗ ╣ ╦ ╬ ▩
I uploaded a beta with the multi-byte legenda at: http://tintin.sf.net/download/tintin-beta.tar.gz |
|
| Back to top |
|
 |
|