2D Toolkit Forum

2D Toolkit => Support => Topic started by: vinnie035 on July 25, 2012, 02:09:21 pm

Title: 'tk2dAnimatedSprite.isPlaying()' is obsolete
Post by: vinnie035 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?
Title: Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
Post by: unikronsoftware 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.
Title: Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
Post by: vinnie035 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?
Title: Re: 'tk2dAnimatedSprite.isPlaying()' is obsolete
Post by: unikronsoftware on July 25, 2012, 08:00:16 pm
Its not a function, its a property. Just call it sprite.Playing without the ()