Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Kinoko on Tue 12/10/2004 16:00:07

Title: DisplaySpeechBackground suggestion/enquiry
Post by: Kinoko on Tue 12/10/2004 16:00:07
I remember talk of modifying DisplaySpeechBackground to include x and y positioning (so, possibly a DisplaySpeechBackgroundAt?) and automatic removal after a period of time. If these haven't officially been added to a suggestion list, then I'm doing so now ^_^
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: strazer on Tue 12/10/2004 16:09:42
Does this work?:

function DisplaySpeechBackgroundAt(int charid, string message, int x, int y) {
  int overlay_id = DisplaySpeechBackground(charid, message);
  MoveOverlay(overlay_id, x, y);
}

As for auto-removal, it's on the tracker:
http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=488
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: Radiant on Tue 12/10/2004 20:22:27
Or, simply add a timer to your display... function, then put code in RepEx(Always) to remove the relevant overlay.
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: Kinoko on Wed 13/10/2004 07:24:59
strazer: Seems fine, but would it work for multiple displays on screen in different posistions, starting at different times, being displayed at once? Just thinking about naming the int there... it'd give that name to multiple instances of the function, wouldn't it? Not sure ^_^;
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: Radiant on Wed 13/10/2004 10:03:11
Have you tried using CreateTextOverlay instead?
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: Kinoko on Wed 13/10/2004 15:01:24
I'm sure I could get it to work okay, but it's just incredibly messy for what I'm doing with this, when having DisplaySpeechBackground be a little more customisable would be so perfect. I'd just like to make that suggestion. If it doesn't go through, then I'll go the long way around out of necessity.

I'm not trying to sound demanding... ^_^ It would just be nice.
Title: Re: DisplaySpeechBackground suggestion/enquiry
Post by: strazer on Wed 13/10/2004 15:45:09
Quote from: Kinoko on Wed 13/10/2004 07:24:59
strazer: Seems fine, but would it work for multiple displays on screen in different posistions, starting at different times, being displayed at once? Just thinking about naming the int there... it'd give that name to multiple instances of the function, wouldn't it? Not sure ^_^;

I'm not sure what you mean. It should display multiple overlays just fine.
If you're talking about overlay_id, it's a variable local to the function. You can add
return overlay_id;
to the above function so it returns the overlay number.

You could then use arrays or something and, as Radiant said, rep_ex to remove the overlay yourself.
Or you wait until auto-timeout for background speech is implemented. As I said, it's on the tracker.