Why is this object not responding?

Started by bx83, Tue 19/05/2020 11:31:40

Previous topic - Next topic

bx83

Hi all

I have an object on screen. It's visible and clickable. I have a method for interact. I've tried it with baseline being where it is, and baseline being 768 (max height of screen). I can't get it to respond with any click, and with interact, the cursor icon doesn't change (indicating that it doesn't have a 'Interact' interaction... except it does). It doesn't even come up with it's own title (all objects in the game with a Description property have it displayed in the upper screen when moused-over). It doesn't have any hotspot's on top of it. It doesn't have a menu on top of it (the menu is invisible anyway).

Why is it not clickable, or doesn't even respond to anything?

Slasher

#1
Something must be in the way and stopping the clicks which includes description. Provided that the clicking is scripted into the function right..
You say the gui menu is invisible and over object... is gui menu clickable=true?   because if it is it may be stopping the click throughs..


Khris

Yes, a GUI with a transparency of 100 will still intercept clicks afaik (because the engine only does a coordinate check).

bx83

Yes I've discovered this also - but how do I get the icon bar (1366x70 bar at top of screen) to *stop* capturing clicks? I've it gIconbar.Visible=false, which means you can't see it, but it's still there :/

Khris

If .Visible is false, it shouldn't capture clicks. Which means there's some other GUI.

You can add this to your global script

Code: ags
function on_event(EventType event, int data) {
  if (event == eEventGUIMouseDown) Display("click on GUI #%d", data);
}


(or just add line 2 inside if the function already exists)

bx83

Which fnuction should I add it to in globalscript? Repeat_always? Not sure what you mean. I already have a on_event in globalscript?..

bx83

Aha, Got it. It's FloatingText, the gui used for the text of an objects Description field. Well now I'm in a pickle.

Khris

Not really, because you can just set the GUI's .Clickable to false (which it should be anyway).

bx83

Solved :D  Just made floatingText unclickable.
Thank you :)

Crimson Wizard

Similar thing happened to me once when I made a custom cursor out of GUI... so I ended up clicking on my own cursor, according to AGS. 

SMF spam blocked by CleanTalk