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.
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"
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.
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...
Ah ok, I see what you're getting at. My bad :=
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.
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. :)
Could this be use for objects too?
It should work with characters, hotspots and objects. "Hotspot" was just used as a term to describe all of these.
It works like a charm and was exactly what I wanted ... you are a star!
And sometimes you don't want it showing a name so just leave the hotspot name box empty and it won't show anything.
:D
Only discovered this now.
Perfect!Perfect!Perfect!
Thankyouthankyouthankyou!
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
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?
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.
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.
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
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!)