mover over hotspot>show its name

Started by Buckethead, Sat 02/09/2006 18:01:13

Previous topic - Next topic

Buckethead

hey,

I want the game to show the name of the hotspot or person where you move the mouse over them. Juts like in all Ben Jordan games. I looked all over the forum and the help file but couldn't find exactly what I was looking for.

R4L

#1
Look in the manual:

@OVERHOTSPOT@

Make a gui, and a label in it that says @OVERHOTSPOT@

Make sure the areas are transparent.

Then under rep_execute:

Code: ags
gStatusLine.Position(mouse.x,mouse.y);


gStatusline would be your GUI name, so if your GUI name was Label, it would be this:

Code: ags
gLabel.Position(mouse.x,mouse.y);


Off my head but im pretty sure it works. Hope I helped.

Buckethead

#2
thnx for the quick reply, i'm going to check it out  :)

EDIT:

err I don't get the rep_execute part... what does that mean?  ???



Candle

It is a module to do that. how could you be confused ?

Buckethead

coz it displays the names in the left corner where my other gui is. Please just explain what Rap4life said a little further  :)

R4L

Rep_execute is in your global script. Open it up and under Game_Start there should be Repeatedly_Execute. Put the code under that. You could have looked it up in the manual pretty easily, but I wanted to save you some time.  :)

Buckethead


R4L

#9
Hmm.. could you please post up your global script?

EDIT: Actually, it seems your either missing a brace at the end (its this })
or you accidently put the code after the closing brace in your repeatedly execute part.

Here:

Code: ags
#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
Ã,  // put anything you want to happen every game cycle here
gLabel.Position(mouse.x,mouse.y);
}
#sectionend repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE


Im pretty sure thats it though. Just put the gLabel.Position(mouse.x,mouse.y); in where you see it in my code, into your global script. Also, I hope your putting the GUI name instead of gLabel. Like I said, if your GUI with the @OVERHOTSPOT@ is called Label, then it will be gLabel.Position blah blah.

Buckethead


Khris

It's supposed to be "SetPosition".

There is a manual, and there's the auto-complete function of the script editor. Is it really too difficult to use either one?
Sorry if that sounded rude, but you might want to do some research of your own first when you're stuck, especially if it's just about one line of simple code.

R4L

Yes what KhrisMUC saidÃ,  :D.

As you can tell, I'm not very good at explaining things.Ã,  :)

It should be gLabel.SetPosition(mouse.x,mouse.y);

Hopefully...

Buckethead

#13
I checked the manual but still I didn't expect SetPosition would be the sulution especially because Rap4life kept saying it was position  :P neverless! I shall read the manual untill I can dream scripting now!!

SSH

Or just read the module's instructions that was posted earlier. This is about the 3rd or 4th person reinventing the wheel recently...
12

R4L

Yeah especially for something so simple. I can't believe I didn't get it right the first time. So this works Buckethead?

SMF spam blocked by CleanTalk