Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: liberator11 on Sun 01/03/2009 20:54:05

Title: Overriding string format char [
Post by: liberator11 on Sun 01/03/2009 20:54:05
I have been reading in from a file and it has for example array[20] and I want to print this directly to the screen but when I do the [ char automatically formats for a new line and I was wondering if there is a way to make it were the formating doesn't act on [ this char.
Title: Re: Overriding string format char [
Post by: Joe on Sun 01/03/2009 20:58:44
If you need to write it in a GUI label then use this:


label.Text=String.Format("Your text %d more text",array[x]);


If you want any character to say it, then:


cCharacter.Say("Your text %d more text",array[x]);


EDIT:Sorry I missunderstood, don't use that.
Title: Re: Overriding string format char [
Post by: liberator11 on Sun 01/03/2009 21:11:26
I tried using that but it still display's on a new line.  I may have not explained it properly.  What I am tryig to do for example is                 Label11.Text = question.Append("array[20]");  And this in return would put the text in the gui label array[20] instead of array (this would be another line) 20]

Making it were the [ char doesn't form a new line instead prints out on the gui label as char [
Title: Re: Overriding string format char [
Post by: Trent R on Sun 01/03/2009 23:11:57
Don't mean to sound like a moderator, but search the forums first.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36944.0 (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36944.0)
This topic deals with the same thing and is only a few days old.



~Trent