Need help with messages while having mouse pointer over object.

Started by Olzn, Thu 12/02/2004 19:42:01

Previous topic - Next topic

Olzn

Hi! I'm trying to make a small maessage somwhere in the screen when the mouse pointer is held over it, so the palyer understands that is is "interactable". ;D
So I tryed with "game-display a message" when pointer is held over hotspot.
This gave me these small messages, BUT. The whole game stopped during the time the message was displayed :o
Can someone please tell me what to do???

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Olzn

OK, and how do I do that then?
(downloaded AGS two days ago so I'm not to good at it yet) ::)

Ishmael

I updated it a bit... but the basic:

- Go to the GUI Editor.
- Click on the "Add Label" button below the GUI Name thingy.
- Draw a resistangle on the GUI, and set the GUI background and foreground colors to your liking
- Strech it to cover the GUI, but don't drag it's edges over the GUI borders. (To resize, drag the lower-left corner of the object)
- Set the font (either 0 or 1, you can preview them in the editor as you set the number. font 1 has black outlines) and font color to your liking
- CopyPaste the code inside the repeadetly_execute function in your global script. (Script menu -> Edit global script)
- Test the game.

Report back then. I hope this clears it ;)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Olzn

ok, just one problem left now... :)
From where am i suppsoed to get the code that's going to be cut into the
repeadetly_execute thingy in the global script?
I checked the room script in the room where I put in the GUI function. When the player moved the mouse over a stone the gui was displayed. So that worked, the only thing is that the  gui is displayed all the time too...

Darth Mandarb

I always use Hotspot 15 (white) and fill in the entire screen around all other hotspots/objects.

Then I Run Script for When mouseOver Hotspot that shuts off the description GUI.

Example:

First, the hotspot interaction(s) ...

[color=00AA00]// any click on Hotspot 1 (a car in the scene)[/color]
SetGuiPosition(6,mouse.x,(mouse.y-15)); [color=00AA00]// sets GUI 6 to the mouse's position (-15 on Y axis)[/color]
SetLabelText(6,0,"This is a car ..."); [color=00AA00]// sets GUI 6's Object 0 (which is the label) to the "text"[/color]
GUIOn(6); [color=00AA00]// turns on the now positioned and populated GUI(6)[/color]

Then ...

[color=00AA00]// mouse moves over Hotspot 15 (the white)[/color]
GUIOff(6);

Then I just re-use the code above to move the GUI around where ever the player clicks.  Sometimes I have to do (mouse.x-100) or whatever if the description would wander off the screen.  It should be easier for you if your description will always be in the same spot.

Although I'm just used to doing it this way ...

There's always @OVERHOTSPOT@ ... look it up ;)

Good luck!

~ d

Olzn

Hmm, this seems as a good way of doing it...
thanks both of you! ;D

SMF spam blocked by CleanTalk