Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 10

animated sprite animation tick counter?

So I have animated sprite with regions, each set to time 96
If I run
then after running that four times, it will add up to 96, and the animated sprite will animate to the next frame
My question is this - how can I check that counter? How can I find out if it's at 0 or 24 or 48 or 72? There is nothing in the documentation that helps.
It MUST be something stored within the sprite itself, or the sprite region itself, but there is no method to access it that I'm aware of.
Any help?
0 Kudos
Level 9

Re: animated sprite animation tick counter?

I was under the impression that an animation-tick and one pass through the event loop were the same thing, so you could at least store that tick-# in the sprite user-data and access it. I'm not aware of any other way to know it, but I don't use the compositor much.
Kinetics Screensavers
0 Kudos
Level 10

Re: animated sprite animation tick counter?

m.compositorTicks +=ticks

Can't you do something like this and try to always stay in sync?
aka watchdog/babysitter. As more gets added add to your babysitter too.

Your babysitter will tell on everything baby does regardless of baby having no ability to speak. Treat it like a baby.
0 Kudos
Level 10

Re: animated sprite animation tick counter?

I have certain sprites coming into and out of existence programmatically all the time, and usually their exact animation timing is independent and doesn't matter, but now I have a few that I'd like to be perfectly synchronized.

I think from both your suggestions, the idea is that I could just manually track it myself, for each sprite. Yeah, I think that's possible I suppose, but darned inconvenient. The thing is, there already exists a tracking counter for each sprite within the Roku system, we just apparently don't have access to it!
0 Kudos