Hello Guest

Author Topic: Sprite/Textmesh zoom to camera and fade out  (Read 3800 times)

matt90410

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprite/Textmesh zoom to camera and fade out
« on: March 20, 2013, 03:39:24 pm »
I'm writing a tile game which consists of a number of sprites and textmeshes.  What I'm wanting to do is when tiles are removed from the screen that the tile spins towards the screen and fades out. 

Is this something that is achievable with 2d Toolkit?

Not sure if it is relevant,  but I am using the tk2dcamera.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite/Textmesh zoom to camera and fade out
« Reply #1 on: March 20, 2013, 11:21:31 pm »
Yup, it is totally achievable with or without tk2dCamera, and the solution is pretty much the same either way.

I suggest using a tween package like HOTween (http://www.holoville.com/hotween/). You can use that to modify the scale so it grows bigger (looks like its getting closer to the screen), modify the z rotation, so it spins & modify sprite.color.a from 1 - 0 so it fades out.

matt90410

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprite/Textmesh zoom to camera and fade out
« Reply #2 on: March 21, 2013, 09:07:52 pm »
Thank you so much for the advice.  I've installed HOTween and got exactly the effect I was after!

On a side note - Not sure if it was just me, but the visual HOTween editor didn't compile properly (from downloading off their website or from the unity store).  I had to manually edit some of the code to do with OnComplete to get it working.