Changing the font of SayBackground

Started by shaun9991, Thu 14/05/2015 10:47:55

Previous topic - Next topic

shaun9991

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

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
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Snarky

#1
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 (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.

shaun9991

Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Snarky

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

SMF spam blocked by CleanTalk