Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Joacim Andersson

#21
Thank you, I did that, and that obviously worked fine.
#22
Thank you, Khris, that solved the issue with the cursor. However, the GUI is still closing, and yes I have it set to pop up when the mouse moves to the top of the screen. But how do I prevent it from closing if the mouse is still at the top of the screen?
#23
Thank you, yes that triggered the click event, but it still just closes the GUI and the cursor doesn't change to reflect the inventory item I've selected.
#24
Hi,

I haven't used AGS for almost 20 years, so many things have changed.
I started a new project from an empty game template, and I've added a GUI that will be the toolbar which is displayed when the mouse moves to the top of the screen. I've added an Inventory Window to this. This works, so that when the mouse moves to the top, the GUI is displayed and the Inventory Window shows my Inventory list.

However, I didn't want to cycle through different mouse pointers for different actions, so I only have one Walk mouse pointer, which is animated (it flashes) when over a hotspot or other character. I also have a Pointer mouse cursor, which is correctly shown when over a GUI.

I have written the following code for the mouse:
Code: ags
function on_mouse_click(MouseButton button)
{
  if (IsGamePaused())
  {
    return;
  }
  
  if (button == eMouseLeftInv)
  {
    player.Say("Inventory Item");
    player.ActiveInventory = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    mouse.Mode = eModeUseinv;
  }
  else if (button == eMouseLeft)
  {
    if (Game.GetLocationName(mouse.x, mouse.y) != "")
    {
      Room.ProcessClick(mouse.x, mouse.y, eModeInteract);
    }
    else
    {
      Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
    }
  }
  else if (button == eMouseRight)
  {
    Room.ProcessClick(mouse.x, mouse.y, eModeLookat);
  }

}
The problem is that when I click on an Inventory item it doesn't get selected and the GUI just closes, I've added the line player.Say(...) if the button is eMouseLeftInv just to debug the code, but the character never says anything. What am I doing wrong here?
 
SMF spam blocked by CleanTalk