Player.Say issue...DisplayAt LOCATION solution ? ( SOLVED )

Started by amuse, Sat 10/04/2010 16:26:31

Previous topic - Next topic

amuse

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



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.

Matti

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.

amuse

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");

Matti

All you have to do is write a line like Labelname.Text="Whatever";

amuse

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.

Sslaxx

It'll stay that way forever unless you set the label text to something else (or nothing).
Stuart "Sslaxx" Moore.

Crimson Wizard

Try this:
Code: ags

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.

amuse

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

Dualnames

#8
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:

Code: ags

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
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Sslaxx

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.
Stuart "Sslaxx" Moore.

SMF spam blocked by CleanTalk