Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Change digits format #316314
03/23/10 09:48
03/23/10 09:48
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Hey

I want to know if it is possible to change the format of the digits while running.

I have a Panel that shows item amounts with 14 digit elements on it.

now i want it that way that if there are actual more than zero items of one kind that the digits will be shown. if not, they shouldn't.

to solve this i wanted to change the format of the digits.
if there are more than zero items the format should be something like "%02.0f"; if not it should be just "" or something like this, so that the numbers are invisible.

Is this even possible?
pan_setvar didn't help me.

greetings

Re: Change digits format [Re: Roxas] #316326
03/23/10 11:20
03/23/10 11:20
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
You can change the format of the strings by simple string coding:
(yes, all you need is a string)
Code:
PANEL* your_pan =
{
//Your stufff here
//Example digits:
digits(0,0,digit_format,NULL,1,variable);
}

STRING* digit_format = "%.0f";//Let's put it first this way
function change_digits(PANEL*panel,STRING* new_digits)
{
//Just a check if your panel is valid
if(panel == NULL)
{
return 0
}
str_cpy(digit_format,"");//Clear existing format
str_cpy(digit_format,new_digits);//And add new format to the string
return 1;

}



That's basicly how you can do it, when you add more complexity (ie need some text before format and so on) look for more str commands in the manual.

Re: Change digits format [Re: Walori] #316328
03/23/10 11:24
03/23/10 11:24
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
You can use 'pan_setdigits' to change digit parameters at runtime.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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