Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Dan Peach on October 26, 2012, 05:11:15 PM

Title: Item highlight image in Inventory
Post by: Dan Peach on October 26, 2012, 05:11:15 PM
Hi,

I'm trying to change the image of inventory items so that when the items are clicked, the image changes to a highlight image.

This is the code I'm trying to use, which I think should work, but just returns an "invalid image" placeholder thing.

Code: WME Script
  1. item.SetSprite("items\" + item + "\" + item + "_inv_highlight.sprite");

Any reason that shouldn't work?

Thanks.  :)
Title: Re: Item highlight image in Inventory
Post by: lof on October 26, 2012, 05:57:11 PM
i need to see the whole code, how do you define "item"?
try Game.Log debugging to see what "item" returns.
if its an entity you might want to try item.Name.
Title: Re: Item highlight image in Inventory
Post by: Dan Peach on October 26, 2012, 06:46:18 PM
Sorry, I should have said, "item" just holds the name of the selected inventory item. Everything else works fine with the selected item, so I don't think that's the problem. The problem just seems to be in the code I've quoted.  :)
Title: Re: Item highlight image in Inventory
Post by: Dan Peach on October 26, 2012, 07:15:06 PM
Ahhhhh, you were right. I just needed to use "item.Name" instead of just "item". All works now. Thanks. :)
Title: Re: Item highlight image in Inventory
Post by: lof on October 26, 2012, 08:23:08 PM
You're welcome :)