Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ghostlady on Wed 02/04/2008 05:00:40

Title: Switching Inventory Graphic
Post by: Ghostlady on Wed 02/04/2008 05:00:40
Does this not work in the new version of AGS?

Mouse.ChangeModeGraphic (eModeUseinv, 36);

I am trying to change the graphic for an inventory item on a specific hotspot.  It doesn't seem to be working.
Title: Re: Switching Inventory Graphic
Post by: SSH on Wed 02/04/2008 10:08:50
If you are using inventory items as cursor graphics, then ChangeModeGraphic has never worked when in eModeUseInv... you'd be better temporarily changing the graphic of the inv item, or changing cursor modes.
Title: Re: Switching Inventory Graphic
Post by: Ghostlady on Thu 03/04/2008 03:19:47
I used this in the "repeatedly execute section of the global script (AGS 2.7) to use a smaller image in the inventory gui and a larger image on the cursor.

Mouse.ChangeModeGraphic (eModeUseinv, 36);

So for what I need now, is the changing the graphic of the inv item. I have a key facing to the right to open doors on the right side of a hallway.  The key is facing the wrong direction for the doors on the left though.  I wanted to swap the key pointing right to the key pointing left when the mouse goes over the hotspots on the doors to the left.

I've tried different things from the manual and I can't get the graphic to swap.
Title: Re: Switching Inventory Graphic
Post by: SSH on Thu 03/04/2008 11:11:44
Try to change the graphic of the inventory item itself, rather trying to change the cursor.



Title: Re: Switching Inventory Graphic
Post by: Dualnames on Thu 03/04/2008 14:24:30
Just to override all things at the interactions you can choose a save mouse while over or something that makes such sense. put your code there.
Title: Re: Switching Inventory Graphic
Post by: SSH on Thu 03/04/2008 14:25:34
Sorry, what do you mean, Dualnames?
Title: Re: Switching Inventory Graphic
Post by: Dualnames on Thu 03/04/2008 14:30:42
I don;t know.. i think what i'm talking about was available for 2.72 and before. nevermind it.
Title: Re: Switching Inventory Graphic
Post by: Ghostlady on Thu 03/04/2008 23:13:33
QuoteTry to change the graphic of the inventory item itself

That's what I am trying to do and it is not working.  What is the syntax?
Title: Re: Switching Inventory Graphic
Post by: Khris on Fri 04/04/2008 06:42:03
  iKey.Graphic = 23;
Title: Re: Switching Inventory Graphic
Post by: SSH on Fri 04/04/2008 10:49:20
It might also be necessary to force the pointer to update by doing something like:

player.ActiveInventory=player.ActiveInventory;
Title: Re: Switching Inventory Graphic
Post by: Ghostlady on Sat 05/04/2008 06:00:15
iKey.Graphic = 23; is what I kept trying.  It does need this also:

player.ActiveInventory=player.ActiveInventory;

that is what finally made it work.