Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: AGheadJones on Thu 05/09/2024 13:22:55

Title: [solved]Change Inventory Bar Position with BASS template
Post by: AGheadJones on Thu 05/09/2024 13:22:55
I'm using the BASS template and i'd like to relocate the inventory bar/GUI to the bottom of the screen. i've been able to change the position of the GUI itself but it only becomes visible/activates when the mouse is at the top of the screen. i've been scouring the global script and TwoClickHandler scripts but i'm not sure how to change the mouseover position to activate at the bottom of the screen.

thanks in advance!
Title: Re: Change Inventory Bar Position with BASS template
Post by: Snarky on Thu 05/09/2024 14:29:22
It's in TwoClickHandler:

Code (ags) Select
bool check_show_distance(int y)
{
  if (y < popup_distance)
  {
    return true;
  }
 
  if (interface_inv != null &&
    y < FloatToInt(IntToFloat(interface_inv.Height) * popup_proportional, eRoundNearest))
  {
      return true;
  }

  return false;
}

bool check_hide_distance(int y)
{
  if (interface_inv == null)
  {
    return y > popup_distance;
  }
 
  return y > popup_distance &&
    y > interface_inv.Height &&
    y > FloatToInt(IntToFloat(interface_inv.Height) * popup_proportional, eRoundNearest);
}

Notice how check_show_distance uses "y < " tests while check_hide_distance uses "y > " tests. That means that the GUI will show itself if the cursor is above some threshold on the screen, and hide itself if it is below some other threshold. By changing this logic and calculations you can make it appear when the mouse is at the bottom of the screen instead.
Title: Re: Change Inventory Bar Position with BASS template
Post by: AGheadJones on Thu 05/09/2024 14:43:02
You're an absolute beauty! thank you so very much!