Page 1 of 1

Textnumber

PostPosted: Mon Jul 02, 2012 12:34 pm
by BogdansB
Hey,
This maybe a stupid question but how can i make a text show "1-3" without calculating so there stands 1-3 and not -2 :S

i used

Code: Select all
if (weapon==1)
{
damage_text.textNumber=1-3;

}


but doesn't works
and when i try to use .text he gives an error "cannot convert from´const double´ to ´ARY[256]char´"

Re: Textnumber

PostPosted: Mon Jul 02, 2012 1:18 pm
by tzoli
It's easy. First: the '-' caracter is not a number(it's an operator) so you have to write in the text variable.
You have to know that you can't define strings with that method you use to define integers.(Incorrect:weapon_text.text="blablabla";)
You have to use the SPRINTF command.
Code: Select all
if (weapon==1)
{
sprintf(damage_text.text,"1-3");

}

Re: Textnumber

PostPosted: Mon Jul 02, 2012 3:26 pm
by BogdansB
thanks :D

Re: Textnumber

PostPosted: Mon Jul 02, 2012 3:30 pm
by tzoli
You are welcome :D