Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started 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.
item.
SetSprite("items\" + item +
"\" + item +
"_inv_highlight.sprite");
Any reason that shouldn't work?
Thanks. :)
-
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.
-
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. :)
-
Ahhhhh, you were right. I just needed to use "item.Name" instead of just "item". All works now. Thanks. :)
-
You're welcome :)