I checked thru the manual and I can't find anything on this and I tried everything I could, but I cant figure it out:
How do I make it so that the name of a hotspot or object will appear on the screen when the cursor is over it?
I know it has something to do with the GUI labels or something, but Im stumped.
If anyone could help me, that would be awesome!
Thanks a bunch!!!
If you need a quick, simple solution, try Gilbot's OverHot script module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23328).
lol sorry. that wont work cuz I dont have internet on the pc I am using ags on. i cant download the module.
Anyone else have a solution?
thx ;D
- Create a new GUI, name it "MOUSEOVER"
- Remove its "Clickable" checkbox
- Put a label on it
- Set the label's text to "@OVERHOTSPOT@"
- Go to menu "Script" -> "repeatedly_execute" and put these two lines in:
function repeatedly_execute() {
gMouseover.x = mouse.x; // move GUI to mouse position
gMouseover.y = mouse.y;
}
You could've easily found something like this searching the forum.
Here's a bit I did as a test some time ago. Retrieving the hotspot name with script was proven to be better than using @OVERHOTSPOT@ some time ago. Anyway, if you find this bit too hard to implement, strazer's code works just fine, and is much easier to put in :)
GUI is called "Ovh" and the label in it is "Overhp".
Beginning of global script:
string buffer;
int width;
function UpdateStatus() {
Ã, GetLocationName(mouse.x, mouse.y, buffer);
Ã, Overhp.SetText(buffer);
Ã, width = GetTextWidth(buffer, Overhp.Font);
Ã, Overhp.Width = width + 1;
Ã, gOvh.Width = width + 1;
Ã, gOvh.X = mouse.x;
Ã, gOvh.Y = mouse.y;
Ã, if(gOvh.X>(320-width)) {
Ã, Ã, gOvh.X=(320-width);
Ã, }
}
And then in repeadetly_execute just add:
Ã, UpdateStatus();
The stausline will behave a bit better when close to the right screen edge. Correcting it's behaviour near the bottom edge is easy too, but for my project it wasn't neccesary so I haven't put it into the code.
thanks guys!Ã, with your help, i figured it out!Ã, Ã, ;) ;D