Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: 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?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Dec 06, 2010 7:23 pm   
 
Perhaps use %format()?
Reply with quote
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: 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       |
|                            |
|                            |
|                            |
|                            |
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: 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.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: Tue Dec 07, 2010 8:55 pm   
 
Embedding a tab character worked perfectly. Thanks, Zugg.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net