Hotspot over character

Started by cjhrules, Thu 31/08/2006 01:19:55

Previous topic - Next topic

cjhrules

Hi!
Is there a way to get a hotspot to display its name when the hotspot is over a "solid" and  "clickable" NPC?



cjhrules

ok, installed it... how do I get it to do what I want... and how do I remove that yellow text that is displayed when I move the mouse over a character?


monkey0506

#3
You can do it like this:

  • Set up a GUI for displaying the text with a Button or Label control on it (I'm assuming you know how to do this).
  • Script Description.GUIMode(gcGUICONTROL); somewhere like the global script's game_start function, where gcGUICONTROL is either a pointer to the Button or Label or the Button or Label's script o-name.

    Let me know if you need more explaining.

cjhrules

ok, I just made an object this time.... but thx  ;)

monkey0506

Uhhhh....so it's fixed then?

Although I'm not really sure how you get an object to display the text..... ???

cjhrules

As I said in the orig post I just wanted the hotspot to be clickable even when over an NPC  character....

monkey0506

#7
Well...I'm not sure about the internal workings of the Description module, but, unless I've missed something, wouldn't Hotspot.GetAtScreenXY() return the correct hotspot even if there was a character in front of it?

Oh...but...the Description module would probably attempt to get the Character's information instead because it's on top and so it would assume...okay...

I don't know if something like this would work, but perhaps you could use:

Code: ags
// room rep_ex
cNpc.Clickable = (Hotspot.GetAtScreenXY(mouse.x, mouse.y) != hotspot[HOTSPOT_NUM]); // HOTSPOT_NUM is the number of the hotspot


But then you say you've already got it working...haven't you? Oh well. Maybe someone else will find this useful. ;)

SMF spam blocked by CleanTalk