Author Topic: Zooming a tiled sprite?  (Read 1914 times)

Slydog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Zooming a tiled sprite?
« 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.
« Last Edit: August 26, 2013, 04:12:07 PM by Slydog »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Zooming a tiled sprite?
« Reply #1 on: August 27, 2013, 02:37:44 AM »
Scale the parent, not the sprite -- and you will get the behaviour you're looking for.

Slydog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Zooming a tiled sprite?
« Reply #2 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.