Hey guys! Can you help me with my game. I want to know how i can get a text when mouse goes over a hotspot. Can you tell!?! :-\
After you have drawn your hotspot. Click on interactions. Then select "mouse moves over hotspot". Click on the down arrow to open the menu. Select "Game-Display a Message" Click "Change", then enter the message number. Click "Edit Message", and there type in the message text. Click "Okay", then "Close". Now when you move the mouse over the hotspot it will say "(whatever you told it to)".
I presume he wanted to know how to write the name of the hotspot next to the mouse pointer or in a status line.
There are a bunch of threads like this - try a search.
Put this in repeatedly execute:
string name;
GetLocationName(mouse.x, mouse.y, name);
SetLabelText(STATUSLINE, 0, name);
Why doesn't anyone ever do anything the easy way? :P
Just create a new GUI and add a label, then enter @OVERHOTSPOT@ for the text.
And then you want to position the text...
And then you want to add "Walk to", "Talk to"...
:)
I know this works becuase its what is in my game...
You'll need a GUI called TOOLTIP with object 0 a text label...
int ttt; // tooltip transparency
string oldloc;
function repeatedly_execute() {
// Set tooltip
string locname;
GetLocationName(mouse.x, mouse.y, locname);
if (StrLen(locname)==0) {
int invat=GetInvAt(mouse.x, mouse.y);
if (invat>0) GetInvName(invat, locname);
}
if (StrComp(locname, oldloc)==0) {
if (ttt>0) ttt--;
} else {
ttt=200;
}
StrCopy(oldloc, locname);
if ((ttt>100) || StrLen(locname)==0) {
GUIOff(TOOLTIP);
} else {
int ttx,tty;
ttx=mouse.x+10;
tty=mouse.y-10;
GUIOn(TOOLTIP);
if (mouse.y<50) {
tty=mouse.y+10;
}
if (mouse.x>260) {
ttx=mouse.x-30;
}
SetGUIPosition(TOOLTIP, ttx, tty);
SetLabelText(TOOLTIP, 0, locname);
SetGUITransparency(TOOLTIP,ttt);
}
hmmm, needs some more comments!
Hey that works! Thanks Guys ;D