Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: Gilbert on Tue 01/11/2005 02:50:57

Title: MODULE: OverHot v1.12 - Display hotspot name under cursor
Post by: Gilbert on Tue 01/11/2005 02:50:57
Here is a very simple module used for automatically displaying the hotspot name under the cursor, using an overlay.

Just import for a game made with AGS V2.7 or above and all will be automagically done, if you want more controls, read the provided text file and the source code of the module.

Download here (http://www.2dadventure.com/ags/overhot_112.zip) (Version 1.12)

Old versions:
V1.0 (http://www.2dadventure.com/ags/overhot1_0a.zip) Initial release.
V1.1 (http://www.2dadventure.com/ags/overhot1_1.zip) Bounding box.
V1.11 Cleanups by Strazer.

Edited 2006-01-18:
Version 1.12 available, should compile now if you use AGS V2.71 and have the "Enforce new-style string" option checked.

Edit 2006-04-30:
Functionality now part of the Description module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26306). The OverHot module will not be maintained any further.
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: SSH on Tue 01/11/2005 09:29:18
Now there's a great bit of work. I think the new String stuff only breaks things when you have a function that takes a string and you try to pass it a String. You can work around all these problems by:

String x
string y;
StrCopy(y, x);
oldfunction(y);

where oldfunction(x) would say "use const string"
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: Pumaman on Tue 01/11/2005 21:34:30
Good idea for a module, Gilbot!

Also, SSH, that's no longer a problem in 2.71 RC2, you can pass a String to a "const string" parameter of a function.
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: SSH on Wed 02/11/2005 09:46:43
Yes, but CJ: if you don't have control of the original function, i.e. a locked module or a plugin or if simply you're a n00b and cut-and-paste some code then it won't work... you have to go and ADD const to the function declaration. However, my workaround above works in those cases where you can't change the function...
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: Pumaman on Wed 02/11/2005 17:43:52
Ah ok, I see what you're getting at. My bad  :=
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: strazer on Fri 04/11/2005 13:45:58
Good work, very nice idea for a module!

But correct me if I'm wrong, using an overlay, true-type fonts won't be anti-aliased, right? Is this mentioned in the ReadMe?
You could give the user the option to specify a GUI that the module would use instead.
Title: Re: Module: OverHot - display hotspotname under cursor
Post by: Gilbert on Sat 05/11/2005 13:50:04
I think I had explained in this thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23316) on why I wouldn't add the ability to display the text as GUI label, the main reason was that I just want it to be simple and can be used immediately without any coding or work. Using a GUI means the user has to create the GUI himself, which beats the use of the module, since it's so simple that if he can create the GUI himself it's more preferable that he put the codes in the script.

Anyway, anyone can just toy with the source to learn how stuff can be done and possible modify it to suit one's personal needs. :)
Title: Re: MODULE: OverHot - display hotspot name under cursor
Post by: Candle on Sun 13/11/2005 12:45:29
Could this be use for objects too?
Title: Re: MODULE: OverHot - display hotspot name under cursor
Post by: strazer on Mon 14/11/2005 18:32:02
It should work with characters, hotspots and objects. "Hotspot" was just used as a term to describe all of these.
Title: Re: MODULE: OverHot v1.11 - display hotspot name under cursor
Post by: ladymeba on Wed 18/01/2006 12:29:08
It works like a charm and was exactly what I wanted ... you are a star!
Title: Re: MODULE: OverHot v1.12 - display hotspot name under cursor
Post by: Candle on Wed 18/01/2006 12:33:28
And sometimes you don't want it showing a name so just leave the hotspot name box empty and it won't show anything.
Title: Re: MODULE: OverHot v1.12 - display hotspot name under cursor
Post by: LimpingFish on Sun 12/02/2006 00:31:09
 :D
Only discovered this now.

Perfect!Perfect!Perfect!

Thankyouthankyouthankyou!
Title: Setting background and border colour in OverHot v1.12
Post by: on Sun 19/03/2006 07:24:41
Hi folks,

OverHot v1.12 working nicely, cheers Gilbot. The only thing I can't figure out is where to set the background and border to 0 so the box doesn't show at all (don't really like that long white label on screen). I don't see it in the GUIs list and can't find it in the module script.

Thanks for your time
Title: Re: MODULE: OverHot v1.12 - display hotspot name under cursor
Post by: Gilbert on Mon 20/03/2006 01:46:52
It does not use a GUI (since using a GUI requires the user to create one himself, which beats the use of modules), it just used a text overlay.
About setting it to 0, I don't quite get what you meant, did you mean setting the colours of the border and backgound to 0 (transparent) ?
That's odd, because text overlays never have backgrounds or borders. Maybe it's your choice of font that the characters are surrounded by some borders?
Title: Re: MODULE: OverHot v1.12 - display hotspot name under cursor
Post by: on Mon 20/03/2006 02:25:41
Not to worry, I finally got the whole @overhotspot@ thing working manually.

All the code I found in the forums was for earlier versions of AGS but someone corrected the outdated terms for me and it works. Maybe I'd put something in the code earlier that stuck a white background and black border around the mouseover description from your module.

Thanks for your reply Gilbot.
Title: Re: MODULE: OverHot v1.12 - Display hotspot name under cursor
Post by: Candle on Tue 02/05/2006 07:46:41
I just happen to find this one and I like it a lot better then the new one .. easy to use and does what I want to do . thank you Gilbot.
Title: Re: MODULE: OverHot v1.12 - Display hotspot name under cursor
Post by: Gilbert on Tue 02/05/2006 07:57:16
Yes, it depends on your need, the description module does much more than this one, so if you need to do more it's advisable to use the new one.

This module is a bit obsolete now, but I won't take it down yet because of these reasons:
- it's simple
- it compiles also for AGS V2.7
Title: Re: MODULE: OverHot v1.12 - Display hotspot name under cursor
Post by: SSH on Tue 02/05/2006 10:23:24
I've tried to make v1.01 of Description default to be more liek OverHot, to make it easier to transition, if people want to. Of course, if OverHot does what you want, stick with it (its better tested, too!)