Switching Inventory Graphic

Started by Ghostlady, Wed 02/04/2008 05:00:40

Previous topic - Next topic

Ghostlady

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.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SSH

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.
12

Ghostlady

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.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SSH

Try to change the graphic of the inventory item itself, rather trying to change the cursor.



12

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SSH

Sorry, what do you mean, Dualnames?
12

Dualnames

I don;t know.. i think what i'm talking about was available for 2.72 and before. nevermind it.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ghostlady

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?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

Code: ags
  iKey.Graphic = 23;

SSH

It might also be necessary to force the pointer to update by doing something like:

player.ActiveInventory=player.ActiveInventory;
12

Ghostlady

iKey.Graphic = 23; is what I kept trying.  It does need this also:

player.ActiveInventory=player.ActiveInventory;

that is what finally made it work.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SMF spam blocked by CleanTalk