|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Mon Dec 06, 2010 7:03 pm
Aligning text in status window |
CMud v 3.32 running in Windows 7.
Is there any way to specifically place text in a status window? I currently have my affects showing up in my status window in two columns, and they are formatted fine when the duration of each affect is two digits (ie 16 tics). But when one of the spells drops below ten tics, the word or part in the second column shifts over one space, and it just looks sloppy.
Is there any way to specifically align the second column so the shifting doesn't happen? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Dec 06, 2010 7:23 pm |
Perhaps use %format()?
|
|
|
|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Mon Dec 06, 2010 7:39 pm |
Maybe I didn't explain my question properly. Looking back, it's pretty confusing.
I have the name of the spell (affect) in my status window, then the next field is the value of a variable for the duration of the spell. When the duration drops below ten (changes to one digit) the whole line shifts over one.
I tried to draw a little ASCII pic to show. I want the "Awen: 13" to remain aligned with the other affects below it.
Properly aligned:
____________________________
| Status Window |
|----------------------------|
| Sanc: 10 Awen: 14 |
| Foci: 14 Fort: 14 |
| Stel: 14 Iron: 14 |
| |
| |
| |
| |
Unaligned:
____________________________
| Status Window |
|----------------------------|
| Sanc: 9 Awen: 13 |
| Foci: 13 Fort: 13 |
| Stel: 13 Iron: 13 |
| |
| |
| |
| |
|
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Dec 06, 2010 7:48 pm |
%format() should do what you want. Of course it is dependent on the script that you use to draw that window.
|
|
_________________ Asati di tempari! |
|
|
|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Mon Dec 06, 2010 7:53 pm |
I took a second look at %format(), and I didn't see the part about "&w.dx" giving a fixed width. I'll give it a try tonight.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Dec 07, 2010 1:28 am |
The Status window also supports tab characters, so you can embed %char(9) to get a tab character and try to line things up with that.
|
|
|
|
Shezmu Wanderer
Joined: 23 Apr 2010 Posts: 53
|
Posted: Tue Dec 07, 2010 8:55 pm |
Embedding a tab character worked perfectly. Thanks, Zugg.
|
|
|
|
|
|