Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Slydog on August 26, 2013, 03:58:01 PM

Title: Zooming a tiled sprite?
Post by: Slydog on August 26, 2013, 03:58:01 PM
This is probably very simple, but I have yet to accomplish this.

I have a tiled sprite completely stretched over my GUI background.
For an added effect, I would like the background to gradually zoom larger, then smaller, continuously using tweening.  (In addition to panning, and maybe rotating, but that is not a problem)

I have it so the background tiled sprite gets larger and smaller, but the tiled image gets recalculated / redistributed each change, resulting in no zooming (as that is the point of a tiled sprite!). 

I think a regular sprite would zoom properly, as it would stretch to fill the new size.  A tiled sprite 'tiles' to fill the new size.  I hope this is clear.  I simply want it to NOT retile the image, just stretch it.

Any advice on how to do this?  (I took a peek at your UIStretch code, but didn't see anything I could use)

Thanks.

[Edit]  In case it wasn't clear, I want the sprite to tile initially when the ui is first displayed (in order to fill the background), but not retile itself anytime after that while zooming, kinda in a tile lock mode.
Title: Re: Zooming a tiled sprite?
Post by: ArenMook on August 27, 2013, 02:37:44 AM
Scale the parent, not the sprite -- and you will get the behaviour you're looking for.
Title: Re: Zooming a tiled sprite?
Post by: Slydog on August 27, 2013, 02:36:16 PM
Thanks a million!
I knew it would be simple (at least I hoped!).
And I have panning and rotating working now too.