Your Digital Media Has Never Looked So Good

 
User avatar
Komag
Topic Author
Posts: 808
Joined: Fri Aug 22, 2014 3:42 am

animated sprite animation tick counter?

Fri Aug 23, 2019 8:34 am

So I have animated sprite with regions, each set to time 96
spriteRegion.GetTime()
96
If I run
Compositor.AnimationTick(24)
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?
 
User avatar
squirreltown
Posts: 870
Joined: Sun Apr 21, 2013 2:20 pm

Re: animated sprite animation tick counter?

Fri Aug 23, 2019 10:33 am

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
 
User avatar
speechles
Posts: 169
Joined: Thu Aug 06, 2015 11:15 pm

Re: animated sprite animation tick counter?

Sat Aug 24, 2019 4:07 pm

m.compositorTicks +=ticks
Compositor.AnimationTick(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.
 
User avatar
Komag
Topic Author
Posts: 808
Joined: Fri Aug 22, 2014 3:42 am

Re: animated sprite animation tick counter?

Sat Aug 24, 2019 9:58 pm

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!

Who is online

Users browsing this forum: No registered users and 4 guests