Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: parthpatel1612 on June 13, 2014, 11:00:32 AM

Title: Changing Sprite and TweenPosition Not working properly
Post by: parthpatel1612 on June 13, 2014, 11:00:32 AM
I am trying to change the sprite at runtime and its work properly but when i tried to use TweenPosition.Begin on the parent gameobject then its changes it back to the default sprite and also changes the scale.

I attaching the pictures of what its doing. I am trying to change the top left calculator icon to audio icon.
First pic - default
Second pic - changed sprite - works properly
third pic - when used tween upper left sprite changes back to the calculator sprite and changes the scale.

Let me know what I am doing wrong.

Thank you
Title: Re: Changing Sprite and TweenPosition Not working properly
Post by: ArenMook on June 13, 2014, 09:39:09 PM
TweenPosition has nothing to do with sprites at all. It's used to move the transform from point A to point B. Your issue lies elsewhere -- possibly in not specifying the sprite's name correctly. Note that it's case sensitive.
Title: Re: Changing Sprite and TweenPosition Not working properly
Post by: gaurav.maniar on July 31, 2014, 01:45:51 AM
can you tell me how to change sprite or image in UI2DSprite???

thanks
Title: Re: Changing Sprite and TweenPosition Not working properly
Post by: ArenMook on July 31, 2014, 11:10:10 AM
GetComponent<UI2DSprite>().sprite2D = someOtherSprite;
Title: Re: Changing Sprite and TweenPosition Not working properly
Post by: gaurav.maniar on August 01, 2014, 12:38:46 AM
Thanks ...