Hello Guest

Author Topic: 'tk2dAnimatedSprite.isPlaying()' is obsolete  (Read 6252 times)

vinnie035

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
'tk2dAnimatedSprite.isPlaying()' is obsolete
« on: July 25, 2012, 02:09:21 pm »
With the previous versions of 2DTK, I was using this kind of code :

Code: [Select]
if (sprite.isPlaying() && sprite.clipId == 1)
{
DoSomething()
}

Now that tk2dAnimatedSprite.isPlaying() is obsolete, what should I use to get a similar result while staying compliant with your new API?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
« Reply #1 on: July 25, 2012, 06:11:18 pm »
The replacement for that function is sprite.Playing. isPlaying will still work, just redirects to the correct function.

vinnie035

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
« Reply #2 on: July 25, 2012, 07:43:16 pm »
If I replace sprite.isPlaying() with sprite.Playing(), I get this error message:
It is not possible to invoke an expression of type 'boolean'.

What did I do wrong?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
« Reply #3 on: July 25, 2012, 08:00:16 pm »
Its not a function, its a property. Just call it sprite.Playing without the ()