Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Melee Island Resident on Tue 19/04/2011 22:58:06

Title: Labelling Help*FIXED*
Post by: Melee Island Resident on Tue 19/04/2011 22:58:06
In order to label different hotspots i used this code:
function hGate_MouseMove()
{
Display("Name of Hotspot");
}


This was quite clunky and made it hard to look at or interact with hotspots, so, is there an easier way to label scenery and other things, perhaps how it was done in MI?

I'm sure there's a really easy solution for this but does anyone have any suggestions?
Title: Re: Labelling Help
Post by: amanta4ray on Tue 19/04/2011 23:51:39
The easiest way to do this would be to create a gui and add a label to it.  In the text of the label add @OVERHOTSPOT@. This will put text over every hotspot, character and object in the game. 

Make sure to set your gui color to 0 and border color to 0 (this will make it invisible, but the words will still show on the label.)

          Hope this helps.... :)

Works wonders for me!!
Title: Re: Labelling Help
Post by: monkey0506 on Wed 20/04/2011 06:22:14
You can also check out the Description module or the Game.GetLocationName function (this last one specifically in conjunction with repeatedly_execute). There's various ways to accomplish this, depending on what exactly you want. ;)
Title: Re: Labelling Help
Post by: barefoot on Wed 20/04/2011 09:58:38
Hi

I think using a label with @OVERHOTSPOT@ can be much more useful than Mouse over in most cases.. as long as it has a basic description..

:=

barefoot
Title: Re: Labelling Help
Post by: Melee Island Resident on Wed 20/04/2011 17:08:16
Quote from: amanta4ray on Tue 19/04/2011 23:51:39
The easiest way to do this would be to create a gui and add a label to it.  In the text of the label add @OVERHOTSPOT@. This will put text over every hotspot, character and object in the game. 

Make sure to set your gui color to 0 and border color to 0 (this will make it invisible, but the words will still show on the label.)

          Hope this helps.... :)

Works wonders for me!!
how do i put the GUI into effect?
Title: Re: Labelling Help
Post by: barefoot on Wed 20/04/2011 17:47:44
Quote from: Melee Island Resident on Wed 20/04/2011 17:08:16
Quote from: amanta4ray on Tue 19/04/2011 23:51:39
The easiest way to do this would be to create a gui and add a label to it.  In the text of the label add @OVERHOTSPOT@. This will put text over every hotspot, character and object in the game.  

Make sure to set your gui color to 0 and border color to 0 (this will make it invisible, but the words will still show on the label.)

          Hope this helps.... :)

Works wonders for me!!
how do i put the GUI into effect?

Open up a Gui from the Gui tree on the right... (Choose the Gui you want to add label to).
Add Gui Label (icon at the top of window - has mouse over descriptions) and add to the Gui (drag and size).
On the Label Property's panel type: @OVERHOTSPOT@ where it says Text..  (Include the @.)

Make sure each Hotspot/Object has a descriptive term in it's property'e panel.

Check out 'Labels' in the manual's index.

Hopefully this will help you..

barefoot


Title: Re: Labelling Help
Post by: Melee Island Resident on Wed 20/04/2011 18:30:31
im pretty sure i did all that but it's not working

what do i put in the properties?
Title: Re: Labelling Help
Post by: Khris on Wed 20/04/2011 18:43:41
"not working" doesn't help us.

Is the GUI/label visible? Did you set the GUI to "Normally, on"?
Did you use a label, not a button/textfield?

We need to know what you did and what did or didn't happen during testing.
Title: Re: Labelling Help
Post by: Melee Island Resident on Wed 20/04/2011 20:12:38
i put it as visible and normally on
and i made sure it was a label
and when i tested it it did nothing different
Title: Re: Labelling Help
Post by: barefoot on Wed 20/04/2011 20:21:34
Hi

i am in the process of labelling as we speak..  Apart from making the Gui being visible I also added Label8.Enabled=true; in room where you want it to start in, use before room fade in (amend Label8 to your Label name.)

If it still fails to show I suggest you go over the manual. especially about GUI's and Labels in this inst.. and check posts on these forums..

barefoot
Title: Re: Labelling Help
Post by: Melee Island Resident on Wed 20/04/2011 20:31:30
im really confused by this
Title: Re: Labelling Help
Post by: Sephiroth on Wed 20/04/2011 21:00:40
This is pretty simple, when you look at the property panel on the right for your Label, you can set the "Text" field to "@OVERHOTSPOT@" without the quotes, now set the "Description" field of your hotspots/scenery to whatever you want to display when the mouse is over it. Or did I miss something, maybe you wanted to do something different or more advanced?
Title: Re: Labelling Help
Post by: Khris on Thu 21/04/2011 00:25:27
If you set the GUI's border color to e.g. 15 (white) does it appear at all?
If you change the label text to "Test" does that appear?

And yes, make sure you put something into the Description fields of the hotspots/objects, otherwise it's obviously gonna stay blank/empty/invisible.
Title: Re: Labelling Help
Post by: Melee Island Resident on Thu 21/04/2011 18:43:34
i have description on almost every hotspot but nothing shows
Title: Re: Labelling Help
Post by: barefoot on Thu 21/04/2011 19:05:47
1: Check the font colour for the label text is not same colour as GUI.

2: Check label is enabled visible.

3: Hold mouse over Hotspot/object in room, does it show any text at all for the label?

4: Are you sure you entered  @OVERHOTSPOT@ (exactly) where it says Text in the labels events panel on the right?

If you still can't get the label to show you should spend some time reading the manual about Labels and GUI's.

Once you get an idea how things work it does get easier.. though not always simple and questions will always arise.

Khris and Sephiroth  have also explained to you about this.


barefoot







Title: Re: Labelling Help
Post by: Melee Island Resident on Thu 21/04/2011 20:34:24
agh i wrote over hostspot
sorry guys it works fine now

thanks for your patience you guys really rule
Title: Re: Labelling Help*FIXED*
Post by: Khris on Thu 21/04/2011 20:56:57
If you misspell the token you see the actual text i.e. your label should've said "@OVERHOSTSPOT@".

Why did you tell us that you didn't see anything then...?
We could have solved this quickly and easily.
Title: Re: Labelling Help*FIXED*
Post by: Melee Island Resident on Thu 21/04/2011 21:15:52
but i didn't see @hostspot@ i would've told you if i did

i did change a few other things around like i had the text as grey and the background as black ::) so maybe i just wasn't looking hard enough

anyway thanks for your help