Hello Guest

Author Topic: From tk2dSprite to animation  (Read 3641 times)

JakeTBear

  • Newbie
  • *
  • Posts: 10
    • View Profile
From tk2dSprite to animation
« on: February 07, 2014, 08:31:15 pm »
Hello,

I have a sprite that doesnt animate, but upon click I want to change it into an animated sprite, I have thought of some ways of doing it (swapping the object for an animated sprite version) but I was wondering if there was another way to do this (in script), any direction towards the best solution would be highly appreciated! thanks :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: From tk2dSprite to animation
« Reply #1 on: February 07, 2014, 11:03:44 pm »
In tk2d 2.0 onwards, the animator is separate to the sprite. All you need to do is turn off the animator (GetComponent<tk2dSpriteAnimator>().enabled = false) if you don't want it to animate.

JakeTBear

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: From tk2dSprite to animation
« Reply #2 on: February 07, 2014, 11:22:22 pm »
So there 's no need to have an "animated sprite" to have animations? they just need an sprite animator? can I give them this sprite animator at run time (with proper set up, as in giving them the right animation to play).

Thanks again!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: From tk2dSprite to animation
« Reply #3 on: February 07, 2014, 11:47:22 pm »
The sprite animator is attached to a sprite (any kind of sprite). You still need the sprite itself, but the animator is separate, unlike tk2d 1.x