How to Not Show Hotspots with Cursor When Inventory Box is Open

Started by Ghostlady, Sun 06/04/2025 00:28:33

Previous topic - Next topic

Ghostlady

Hi, currently when the inventory box is open and it's sitting in the middle of the screen but on some hotspots, if I move the mouse around within the inventory box, and it rolls over a hotspot, it changes the cursor to the Interact graphic.  Here is the code I use in my global script.  How this works is that the Inventory box opens and there should be an "arrow" cursor.  When the mouse rolls over an inventory item, the cursor graphic changes to the interact pointer. I shouldn't be seeing hotspots within the inventory box.


Code: ags
  // ** CUSTOM INVENTORY WINDOW
  gInventory.Visible = true;
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

Can anyone help me with this?  This room has multiple directional hotspots.  When a gui is open, in this case the inventory gui or the interface gui, if the mouse rolls over one of the hotspots while the gui is open, it picks up hotspot and changes the mouse cursor, disregarding the mouse for the gui.  How can I stop this from happening.  See video for an example.

https://youtu.be/R_aq8aiVV4M
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

One easy way to fix this is to make the GUI as big as the screen and use a background image with a transparent border. A clickable GUI will prevent the cursor from reacting to hotspots even if the background is completely transparent.

Another way is to check if the GUI is open before changing the cursor. Is this done in repeatedly_execute code? Or are you using the built-in way (AnimateOnlyOnHotspots)?
If it's the former, you can just wrap the code in
Code: ags
  if (!gInventory.Visible && !gInterface.Visible) {
and
Code: ags
  }

Ghostlady

Interesting about the background with a transparent border.  I am going to try that.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SMF spam blocked by CleanTalk