Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Valentine on Wed 17/10/2007 12:43:31

Title: Simultaneous @OVERHOTSPOT@
Post by: Valentine on Wed 17/10/2007 12:43:31
Hi, I'm using an interface in which a hotspots name is displayed just slightly over the mouse cursor when the mouse hovers over it (so a GUI with a @OVERHOTSPOT@ label, set at mouse.x,mouse.y-20 for example).

However, I want a way for every hotspot label on the screen to show up simulataneously when the player holds down the spacebar. I think Simon the Sorcerer 2 had a similar feature, in which gold stars highlighted each hotspot on the screen - I want to do this, only with the hotspot names showing up.

I'm completely bewildered about how to go about this. I don't need someone to give me the code (I'd prefer to attempt it myself - at least at first :)) but I'd really appreciate it if someone could suggest a way of going about this, where do I start off?

Thanks for the help.
Title: Re: Simultaneous @OVERHOTSPOT@
Post by: Ashen on Wed 17/10/2007 13:30:11
You could use Text Overlays, but here's a limit of 10 on screen at once which could be a bit, erm, limiting. Better might be a GUI with a bunch of Labels than can be shuffled to the right places and set to the proper text. GUIs have a limit of 30 controls, which is a bit better than 10 Overlays. If you need more - seperate GUIs for Hotspots, Objects and Characters would give 90 possible Labels at once, which should be more than enough. Custom Properties could be used to store an offset value, to place the Labels relative to Hotspot Walk-to points, Object coords, etc, or to specify an exact point, if you'd rather.

I'm not entirely sure how it'd work, but as you're only asking for suggestions at the moment I don't have to be...
Title: Re: Simultaneous @OVERHOTSPOT@
Post by: Khris on Wed 17/10/2007 13:54:16
Or RawSaveScreen(); first, draw all hotspot names (RawPrint), then after the space bar is released: RawRestoreScreen();

To go through available hotspots/objects, use the arrays: hotspot[] & object[]
Room.ObjectCount holds the number of objects.
Title: Re: Simultaneous @OVERHOTSPOT@
Post by: Akatosh on Wed 17/10/2007 17:19:04
If you use the RawDraw approach, however, you can't put the name of objects in the room directly on them, as RawDraw alters the room background and objects are displayed in front of that.
Title: Re: Simultaneous @OVERHOTSPOT@
Post by: Khris on Wed 17/10/2007 17:34:55
Correct, I didn't think of that when I posted. In the meantime I've written a working module; objects are saved, turned off and then drawn on the background first.

Right now I need to fix the very small font I've created so it'll display umlauts properly.
Title: Re: Simultaneous @OVERHOTSPOT@
Post by: SSH on Wed 17/10/2007 17:54:59
You could always RAwSave, RawDrawRectanlge the BG all (255, 0, 255), RawDraw on to that, grab it as a Dynamic Sprite and then put the sprite on an overlay or GUI. This would mean any objects and chars can carry on animating, etc.