Wintermute Engine => Technical forum => Topic started by: Catacomber on May 05, 2009, 02:11:25 AM
Title: Changing a sprite image in a layer
Post by: Catacomber on May 05, 2009, 02:11:25 AM
I have a closeup layer with a background image and then an entity containing a sprite image of a closed bureau. I want to change the image to an open bureau. I get this script error:
Call to undefined method 'SetSprite'. Ignored.
This is the script that is part of a puzzle that should change the image. I tried Layer.GetNode instead of Scene.GetNode, that didn't work. Any help is appreciated:
Title: Re: Changing a sprite image in a layer
Post by: Catacomber on May 05, 2009, 04:58:48 AM
I solved this by moving things around--so it's still Scene.GetNode in the layer to change an image in the layer. Not a bad thing to know since I couldn't find anything searching the forum. : )
Title: Re: Changing a sprite image in a layer
Post by: Mnemonic on May 05, 2009, 07:02:32 AM
Yes, I think it's always a better idea to query the node just before you're going to use it. In the beginning of the script you can't be sure what parts of the scene are already loaded and ready.
Title: Re: Changing a sprite image in a layer
Post by: Catacomber on May 05, 2009, 02:47:32 PM
Thank you, Mnemonic. Filing this thread away in my help folder. : )