Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
digits string format align number #330996
07/01/10 14:22
07/01/10 14:22
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
hello
im trying to figure out , how to align this string

digits(-100,15,\"%-5.f Messages \",font_arial_14,1,stat_2);

what i want it so show:

Code:
ex: 20 messages
   100 messages
 10000 messages 

and not 

20 messages
100 messages
10000 messages



what is the format to align the number to the left side, and then the trail message string.

From the manual a tried the flag -, and the width of 5 as you see, but.. it is not working.. because when the number increase the message text will move to the right.

thanks

Last edited by MMike; 07/01/10 14:22.
Re: digits string format align number [Re: MMike] #330999
07/01/10 14:27
07/01/10 14:27
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
AFAIK it's not possible with digits, but you can use texts with ARIGHT.

Re: digits string format align number [Re: Lukas] #331007
07/01/10 14:55
07/01/10 14:55
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
First , thanks.

I asked that feature longe ago on the future section, to let panels be left aligned too...



Last edited by MMike; 07/01/10 18:11.
Re: digits string format align number [Re: MMike] #331048
07/01/10 18:12
07/01/10 18:12
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Please somebody help me, what does this :
"[text1]%[flags][width][.precision]f[text2]" from digits...

if [flags] = Optional one or more of the following characters:
- = Left align the number within the given field width. Default: Right align."


how i use the "-" thing? i have this:
digits(-90,26,\"%-5.fMessages\",font_arial_14,1,stat_2);
digits(-90,37\"%0.f Notifications\",font_arial_14,1,stat_2);

and they display the same text in the same way, and position, so its not working i assume?

Re: digits string format align number [Re: MMike] #331524
07/04/10 20:43
07/04/10 20:43
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Anyone Come on!

How i use the alignemnt? i see no differences on using the "-" flag?
Thanks.

Last edited by MMike; 07/04/10 20:43.
Re: digits string format align number [Re: MMike] #331538
07/04/10 22:08
07/04/10 22:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Works fine for me...

As a test, try changing the font to courier,
so you can see the spacing more clearly.

Heres a sample panel...
Code:
PANEL* test = 
{	
	pos_x=20;	pos_y=20;	size_x=200;	size_y=120;		flags= SHOW;

	digits(10,10, "12345678901234567890", "Courier#18b", 0, 0);
	digits(10,30, "%.0f and some text", "Courier#18b", 1, 10);
	digits(10,50, "%5.0f and some text", "Courier#18b", 1, 10);
	digits(10,70, "%-5.0f and some text", "Courier#18b", 1, 10);
}


Looks ugly as hell, but you can see it working.

Remember, arial is a "proportional" font.
Different characters have different 'widths".
ie a 'space' character is narrow compared to a 'W'.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: digits string format align number [Re: EvilSOB] #331555
07/05/10 00:35
07/05/10 00:35
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
right.. werd, but the option i want is the, wihout the - thing .... but i have to put the 5 before.. i was using or-5 or 0.f ..
somebody with atention would tell me that i was wrong.. but lol
Ok evilsob, thanks for your "help" that you always do.

Re: digits string format align number [Re: MMike] #332574
07/10/10 20:24
07/10/10 20:24
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
okay i just think i found a bug.. thats why it did not work. i was using arial
var stat_2;

and create a panel with this:
Code:
PANEL* test = 
{	
	pos_x=20;	pos_y=20;	size_x=200;	size_y=120;		flags= SHOW;

	
	digits(90,37,\"%5.0f Messages\",Arial#18b,1,stat_2);
	digits(90,56,\"%5.0f Messages\",Courier#18b,1,stat_2);
	layer=7;
}



then on the console change stat_2=1; then 10; then 100
and they will act very very different... See why i was confused?

Also times font wont work!? (evil, you, told about the space thing, but thats not even stated on the manual is it? and.. the feature says it for aligment.... nothing to do with the text being courier.. i mean, thats not logical!
And im not using spaces, just numbers.

the manual is clear "
TrueType or bitmap character set for the display. Either a predefined FONT, or A6.6 a font filename or Truetype font name with size and style (like "Arial#24bi") can be given. If '*' ist given, the engine standard font is used."


The font could be defined with :
FONT* ac1="Arial#18b";
FONT* ac2="Courier#18b";

but also it wont work! they mess up the alignment...
I will have to postpone the text ui part of the project, because of this issue.


Last edited by MMike; 07/10/10 20:36.
Re: digits string format align number [Re: MMike] #332603
07/11/10 02:50
07/11/10 02:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK, I dont have have access to A7 ATM, on holidays.
So Im helping eather 'blind' at this time.
But I'll do my best...

Q1>
Quote:
and they will act very very different... See why i was confused?

No, without A7 I cant. What do you mean?

FYI The example you given is bad, shouldnt even compile. Is it badly typo'ed?
Click to reveal..
Code:
PANEL* test = 
{	
	pos_x=20;	pos_y=20;	size_x=200;	size_y=120;		flags= SHOW;

	
	digits(90,37,"%5.0f Messages","Arial#18b",1,stat_2);
	digits(90,56,"%5.0f Messages","Courier#18b",1,stat_2);
	layer=7;
}




Q2>
Quote:
Also times font wont work!? ...
Probable not. Its not mentioned
in the manual cause its assumed you are already aware. Its a windows thing.
Open the "fonts" folder in c:\windows and look at the list. If the icon is an
'O' or a 'TT' then this spacing issue will be a problem with that font. (proportional)
If the icon is an 'A' it will space the way you want. "non-propertional"
Problem is, all those fonts look ugly and retro...
Try using bitmap fonts instead....

Q2a>
I know you are using numbers, but when you are using the alignment specs,
"the engine" uses spaces to set the aligmnment how you ask.
Thats when the "narrow" spaces some fonts have make a mess of any
text that comes after the number.

The best way would be to have the number as a separate 'digit' to the text.
ie...
Code:
PANEL* test = 
{	
	pos_x=20;	pos_y=20;	size_x=200;	size_y=120;		flags= SHOW;

	
	digits(90,37,"%5.0f","Arial#18b",1,stat_2);
	digits(100,37,"Messages","Arial#18b",0,0);
	digits(90,56,"%5.0f","Courier#18b",1,stat_2);
	digits(100,56,"Messages","Courier#18b",0,0);
	layer=7;
}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: digits string format align number [Re: EvilSOB] #332608
07/11/10 03:49
07/11/10 03:49
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Well i hope your enjoying your holidays ehh..
Well but that FONT issue is weird, because GS could handle it .. i mean.. thats stupid right.

And, i know the code wont compiled, i just copy pasted and arranged here, because this is inside a pan create actually.. but you got the point.


Well letme see now the other post ehhe, where you answered. And Thanks

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1