Hi,
I am using - player.Say - to display the general text in my first game, but It created a problem which I can't seem to find any solutions for.
The present workflow : I've placed cEgo at the bottom of the screen but not showing him.
See image
(http://www.amusefilms.com/game/text.jpg)
1 - When I use just line of text is works perfecly.
2 - when I use two lines of text, then the text ends up to high.Because ofcourse the text always have to be above cEgo.
3 - This diplays how I am using the Character location for the Text and use the - Player.Say - code
For the solution - So far I am wishing I missed something easy like : having the possibilty to display text UNDER the cEgo. this would and up being a 2 secs fix :)
The other solution i've tried is to create a GUI Textbox
#define TEXTLOCATION destX, destY, destWidth...and all that.
Which actually worked but then I could not CENTER the text... just got the Left to Right Text.
then perhaps there is an easier way to do this in my already existant Bottom of the Sceeen UI?
So my question : how should I do this ? :)
Thanks
EDIT - thanks for all the replies the solutions works perfectly.
You can use a GUI label instead of a textbox. There you can center the text.
Or you just set a higher y-coordinate for the character in each case where the text is too long. But I'd say this is terribly unhandy. I'd go for a GUI label.
Good.
So I create a Label on the Bottom GUI, named it - MyText - then the code to use it would be ?
So far I failed with :
DisplayAt (MyText, "Here is where you work - The Fletcher Memorial Hospital");
All you have to do is write a line like Labelname.Text="Whatever";
ok, things are starting to look good!
My remaining issue is this: How do I use this like I used the cEgo's text
In exemple when I convert :
player.Say ("Here is where you work - The Fletcher Memorial Hospital");
player.Say ("This Hospital has a nice history to discover specialy in this part");
player.Say ("Usualy, you work down in Ward 3.... an everyday hospital floor");
to :
MyText.Text="Here is where you work - The Fletcher Memorial Hospital";
MyText.Text="This Hospital has a nice history to discover specialy in this part";
MyText.Text="Usualy, you work down in Ward 3.... an everyday hospital floor";
I do not the the same behavior at all:
The first code displays the first line - waits for a user input - the displays the second line, etc
The second code only displays the Last line that stays for ever.
It'll stay that way forever unless you set the label text to something else (or nothing).
Try this:
MyText.Text="Here is where you work - The Fletcher Memorial Hospital";
Wait(80);
MyText.Text="This Hospital has a nice history to discover specialy in this part";
Wait(80);
MyText.Text="Usualy, you work down in Ward 3.... an everyday hospital floor";
Wait(80);
MyText.Text="";
If you need, change number in Wait() to something else. 40 is about one second. 80 is 2 seconds etc.
that set me on the right path.
I decided to go with - WaitMouseKey(180); - which I looked up after seeing the last suggestion.
thanks, this will do nicely. Works with slow readers and allows the quick clickers to jump foward.
amuse
Why don't you use a label, and then calculate how long will the text you want displayed be told, and use something like that:
function CustomSay(this*character, String msg);
Label.Text=msg
//Label.TextColour=this.SpeechColor//Not sure if this actualy exists as a property of the label
Wait(calculated time);
}
Just an idea..It's very roughly coded, and I'm only suggesting.
EDIT: Lol, just missed one's post that suggests exactly this. Let me find you the code:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38088.0
Quote from: amuse on Sat 10/04/2010 18:34:18
that set me on the right path.
I decided to go with - WaitMouseKey(180); - which I looked up after seeing the last suggestion.
thanks, this will do nicely. Works with slow readers and allows the quick clickers to jump foward.
amuse
WaitMouseKey sounds more useful than plain Wait, really.