Closed Theodeus closed 7 years ago
Oh, I'm at line 628 in howler.core.js.
The sprite definition is [start, duration]
, not [start, end]
. If you look at https://howlerjs.com/#sprite you'll see that sprites are indeed working correctly.
Ah, gotcha! I thought I'd read the entire documentation, but what do you know. :)
The fact that the numbers in the quickstart were sequential totally threw me off! Thanks for the quick reply!
Yeah that is a good point, I should probably change that as I can see how that is confusing.
By the way, why not just do
var duration = self._sprite[sprite][1] / 1000;
The seek position isn't necessarily the starting position of the sprite. That would cause the duration to be incorrect in the event that you started to play, paused and then resumed.
Aah. Gotcha!
This doesn't look right, or perhaps I'm not getting how the sprite definition works. :) So I have this:
... and in this case howler thinks the loading part of the sprite is 8.629999999999999 seconds long. I've just assumed I'm giving the start and end time of the sprite in milliseconds. If I'm correct in that assumption, shouldn't the calculation just be
I'd be happy to submit a PR if I'm right. I'd also be happy to be corrected if I'm wrong. :)