Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaun9991 on Thu 14/05/2015 10:47:55

Title: Changing the font of SayBackground
Post by: shaun9991 on Thu 14/05/2015 10:47:55
One final question (sorry for clogging up the board!! :/ ) - is it possible to change the font for the SayBackground command to a different one from the Say command - I still want to retain SayBackground, but I've made the default speech font invisible so I can use my custom speech gui. I basically want to still keep the Lucasarts style SayBackground with a visible font. Would I have to manually redefine the Speech font each time I use saybackground, then set it back to the invisible one?

I've got this far -
Code (ags) Select

void background(this Character*, String message){
  Game.SpeechFont = eFontfntDefault;
  this.SayBackground(message);
  Game.SpeechFont = eFontfntSpeech;
}


But the character doesn't do their talking animation when this is called.

Any help much appreciated :)

Thanks,
Shaun
Title: Re: Changing the font of SayBackground
Post by: Snarky on Fri 15/05/2015 07:03:22
That's a limitation/arguably-a-bug in SayBackground(): It doesn't play speech animations. You'll need a helper function that also animates the character while the text is displayed.

There are a number of modules that provide this, but check out monkey's post here (http://www.adventuregamestudio.co.uk/forums/index.php?topic=51947.msg636510794#msg636510794) (just that post, not the module in the thread), which provides a concise version of the code needed.

Your code looks correct otherwise, but test it to see what happens if there's background speech and "foreground" speech overlapping or interrupting each other.
Title: Re: Changing the font of SayBackground
Post by: shaun9991 on Fri 15/05/2015 15:30:44
Thanks Snarky! You are a legend!
Title: Re: Changing the font of SayBackground
Post by: Snarky on Fri 15/05/2015 15:36:43
D'oh! I actually linked to the wrong post (I didn't at first see that you'd solved the original problem you asked about, and linked to an explanation of that). Here's the post I meant: http://www.adventuregamestudio.co.uk/forums/index.php?topic=35787.msg636460558#msg636460558