Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: R4L on Wed 25/08/2004 07:18:27

Title: Mouse Displaying Hotspot Name(SOLVED)
Post by: R4L on Wed 25/08/2004 07:18:27
I didn't know where to post this. How do you make a mouse that displays the hotspot like in 7 Day a Skeptic? Instead of making a GUI like in 7 Days, I want to have the hotspot name under all the mouse cursors. Could anyone help me? Thanks.
Title: Re: Mouse Displaying Hotspot Name
Post by: Mr Jake on Wed 25/08/2004 08:18:00
you mean a mini status line that follows the mouse? (didnt play 7das)

you need to make a small GUI with a @OVERHOTSPOT@ label and you need to make it follow the mouse by updating its co-ords relative to the mouse in rep_exe, remember that you will have to do something for when it is near the left, right or bottom of the screen if you have it hovering under the mouse otherwise half of the box will be out of the screen or you will get an error.
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 08:57:24
In 7 Days a Skeptic, whenever you move the mouse over a hotspot or character, it displays the hotspot/name.

I don't know how to do this, but I want to know.
Title: Re: Mouse Displaying Hotspot Name
Post by: Mr Jake on Wed 25/08/2004 09:15:43
put @OVERHOTSPOT@ as the text for a label.
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 09:21:21
I did that but there is no way to make it follow the mouse just from the GUI editor. There are four options.
Normal
MouseYPos
Pop-up Model
Persistant

None of these make the GUI follow the mouse.

EDIT: AHHHHHHHH!!!!!!!!! I AM SO STUPID!
Hotspot1>Interaction Editor>Mouse moves over hotspot
Hotspot, thanks for helping!
Title: Re: Mouse Displaying Hotspot Name(SOLVED)
Post by: Mr Jake on Wed 25/08/2004 09:30:49
personally I would just make the GUI follow the mouse but putting something like

SetGUIPosition (X, mouse.x-15, mouse.y);

in Rep_exe, how ever I can see how your way might be better as you dont have to muck around with the edges of the screen (to make sure that the GUI isnt outside of the screen)
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 09:36:14
I wish my way was better. I don't know the scripting that would make it follow it. I don't know what would work.

EDIT: I think your way would work, but I don't know where to add the SetGUIPosition (X, mouse.x-15, mouse.y); at.
Title: Re: Mouse Displaying Hotspot Name
Post by: Mr Jake on Wed 25/08/2004 09:42:02
if you used your way in 'mouse over hotspot' you could add that line of code,

in my way the code goes in the rep_exe section in the global script
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 09:45:33
OKÃ,  I have tried it, but if I move the mouse to any other hotspot, it still displays on the first one.
EDIT: Thanks for helping me in all, but I have decided I won't have the mouse to display the hotspot name. Sorry if this makes you angry in any way(I don't think it will).
Title: Re: Mouse Displaying Hotspot Name
Post by: Ashen on Wed 25/08/2004 11:25:16
OK, so I know you've given up on the idea, but I had a go any way:

in the global rep_ex:
  if (GetLocationType (mouse.x, mouse.y) == 0) GUIOff (GUI4); // turns GUI off if there's nothing there
  else {
    SetGUIPosition (GUI4, mouse.x+15, mouse.y);
    GUIOn (GUI4);
  }

Where GUI4 is the mouse-following 'status line', with a text label containing '@OVERHOTSPOT@', wide enough to handle whatever object/hotspot/character names you have.

Might be some use, if you change you mind, or maybe to someone else.
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 14:00:32
Thanks!

Where is the Global rep_ex?
EDIT: Never mind(man I am retarded)
Title: Re: Mouse Displaying Hotspot Name
Post by: R4L on Wed 25/08/2004 14:04:57
*Sorry Double Post*

Thanks alot Ashen! It works now! I also thank you hotspot!