Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Dave Gilbert on Tue 02/05/2017 17:41:38

Title: Changing portrait position separate from text?
Post by: Dave Gilbert on Tue 02/05/2017 17:41:38
Hi all. So I am using Sierra style portraits in my game. Here are some examples:

(http://www.wadjeteyegames.com/temp/unavowed-vicki.png)

(http://www.wadjeteyegames.com/temp/unavowed-eli.png)

I am trying to readjust the portraits so the characters' faces are level with the text (that way the player's eyes are more drawn to their expressions, which are easy to miss). I tried changing the Speech.PortraitY parameter, but it moves the TEXT along with the portrait. Is there any way to move the portrait by itself? Or a way to move the TEXT by itself? Either will do!

Thanks in advance,

-Dave
Title: Re: Changing portrait position separate from text?
Post by: CaesarCub on Tue 02/05/2017 20:06:26
I know it's completely hackerish, and might not work for your project, but what I did to solve it for one game I did was to add transparent padding to the top border parts of the text window UI:

(http://i.imgur.com/cwrqbCc.png)

If there is a correct way to solve this, I'd love to know it.
Title: Re: Changing portrait position separate from text?
Post by: Dave Gilbert on Tue 02/05/2017 20:12:33
Not a bad idea! I'll try that, failing any other option.
Title: Re: Changing portrait position separate from text?
Post by: abstauber on Wed 03/05/2017 09:50:31
I use a custom GUI in connection with my own little extender function:

function Speak(this Character*, String say, int loop, TextSpeed speed,  int timeout, bool append, bool hidePortrait, bool bgspeech)

(http://i.imgur.com/PAcQkbr.png)
That way I don't have to worry much about any builtin AGS Speech. On a downside, dialog scripts do not look as nice as before

@1
  player.Speak("Just saying.");
Title: Re: Changing portrait position separate from text?
Post by: Snarky on Wed 03/05/2017 12:38:32
Yeah, if there isn't an immediately obvious API for controlling the text box offset (and I don't know of one), I would think either of these methods (building in transparent padding or writing your own dialog system) are the available workarounds.
Title: Re: Changing portrait position separate from text?
Post by: Dave Gilbert on Wed 03/05/2017 13:23:50
Righto. Workarounds it is!

@abstauber I actually use my own custom say function anyway, so I can do various things on the fly (like change portrait direction, change expressions, etc) so the dialog script stuff isn't an issue for me. The difficulty is getting the speech window border images to resize correctly depending on the size of the text string, which is something I haven't quite figured out yet.
Title: Re: Changing portrait position separate from text?
Post by: Crimson Wizard on Wed 03/05/2017 13:59:28
Quote from: Dave Gilbert on Wed 03/05/2017 13:23:50The difficulty is getting the speech window border images to resize correctly depending on the size of the text string, which is something I haven't quite figured out yet.

BTW, not certain if this is related to your case, but you might check my recent post on this, AGS has certain mistakes in GetTextWidth and GetTextHeight functions:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=54501.0
Title: Re: Changing portrait position separate from text?
Post by: Dave Gilbert on Wed 03/05/2017 14:19:54
Ah! That's good to know. Thanks for pointing it out, CW.