Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Tanique on Tue 14/07/2009 19:29:52

Title: Speech Text Disappears a certain y coordinates
Post by: Tanique on Tue 14/07/2009 19:29:52
I'm not sure if this should go in the Beginners Forum instead but I think it's more of a bug than an error on my end (although you may prove me wrong).

I am trying to display all speech text along the bottom of my screen in various character specific colors.  I have created a custom function for this:

function say(Character* characterName,  const string speak)
{
characterName.SayAt (int x,  int y,  int width, speak);
}

Then for my various character speech I can just type:

say(cEgo, "Blah Blah Blah");

And it will always display the text in the same spot in the specific character's color.  This was working great on a project in 1024x768 resolution.  Now I'm working on a project in 640x400 and if the "int y" coordinate reaches anything beyond 350 the text just disappears.  I have a 30px tall black window along the bottom of the screen (not as a gui, painted in the room background).  I want text to display in this black area so I need to get "int y" to 370 or more for text to show up in this black window.  Any idea why the text won't display below 350?  I've tried with both Sierra and LucasArts speech styles.  Sometimes the text will disappear if i go below 350, then maybe 354 depending on what font style/size I try.  But eventually they all disappear when they should still be visible, just lower on the screen.

I have also tried using the standard "cEgo.SayAt(int x, int y, int width, string...)" so I know it's not a custom scripting mistake.  In both cases the speech text disappears when int y gets around 350.

Help? Ideas?  Thank you!
Title: Re: Speech Text Disappears a certain y coordinates
Post by: Pumaman on Wed 15/07/2009 18:43:38
There shouldn't be a problem doing this -- especially with Lucasarts-style speech.

If you try to display it below 718 in the 1024x768 game, does that work?
Title: Re: Speech Text Disappears a certain y coordinates
Post by: Tanique on Thu 16/07/2009 03:39:24
Yes, in the 1024x768 game I was experimenting with I never had any problems placing text anywhere.  I can place it as low as 768 itself and it'll still show, although mostly cut off.  All of a sudden I try the same technique in 640x400 and the text seems to have a limit to how low it will go before just disappearing all together.  The "Display" options seems to work fine in 640x400 and will show anywhere, but "cCharacter.SayAt" doesn't seem to work the same.  I also tried putting the text in a 30 tall bar along the top of the screen instead of the bottom of the screen and made the y coordinate "0" and the text was not right at the top, but a ways down below the black bar and nothing I did would place it higher.  It seems maybe there's a coordinate issue with the "SayAt" function?  I tried both at the top and bottom locations with various fonts/sizes and the result was always the same.  It's almost like there's a buffer/border along the top and bottom that speech text can't be placed in for the 640x400 resolution.

I dunno, it's weird.  I'm just leaving text floating above their heads for now hoping to deal with this issue later on.  But any ideas are greatly appreciated!
Title: Re: Speech Text Disappears a certain y coordinates
Post by: Pumaman on Thu 16/07/2009 18:32:08
Would it be possible to upload a sample game that demonstrates the problem?
Title: Re: Speech Text Disappears a certain y coordinates
Post by: Tanique on Fri 17/07/2009 00:07:01
Um, actually the game that was having the issue I've redone the scripting so it's just floating the speech above their heads now.  I'd have to re-do the problem scripting in order to upload it. However, I tried to duplicate the problem using the dummy template game AGS comes with and all of a sudden the text worked anywhere again in both resolutions.  I must have an internal setting or script or something screwing it up in my other game.  I'll keep playing with it and see if I can figure it out.  I'll update this thread if I come up with anything.
Title: Re: Speech Text Disappears a certain y coordinates
Post by: Shane 'ProgZmax' Stevens on Wed 22/07/2009 00:28:44
I haven't seen this happen but I have noticed some weird positioning issues with SayAt (I've mentioned this before, somewhere).  Sometimes I'll have to fidget with the SayAt coords to get it to display centered at a specific point, like using 160/200 won't necessarily display the text centered near the bottom in a 320x240 game.  I'm not sure exactly how the text display routine works, though, so rather than centering the text at those coordinates it could be using it as the upper left, lower left, or whatever of the text.  Some confirmation on how text is displayed at coordinates in the manual would be great -- or even better -- a variable added to SayAt, etc, to allow you to select how text is justified at specific coordinates!  That would make text placement in some of my cutscenes one HELL of a lot easier.