Previous block of code is royally bugged. If you have a delay time of longer than the animation, it bugs out. I created a bug report on the forum but it was when nate was on his hiatus.
I haven't. again, our implementation of spine is... yay. I will fiddle with the code for the start event. good idea!
I didn't try set animation, however it isn't particularly needed, because as soon as you say setAnim
you can edit the time as it would be the current track. We do this (A LOT) in another game, and we play animations backwards using this method (used in loading bars)
08 Mar 2016, 17:06
[C Runtime] Add Animation with Delay Bug is the thread, although code may not be 100%
08 Mar 2016, 17:15
TrackEntry next = current.next;
if (next != null) {
float a = current.lastTime - next.time + next.delay;
next.time = current.lastTime - next.delay;
if (next.time >= 0) { next.time = a; next.lastTime = a; SetCurrent(i, next); };
} else {
// End non-looping animation when it reaches its end time and there is no next entry.
if (!current.loop && current.lastTime >= current.endTime) ClearTrack(i);
}
public TrackEntry AddAnimation (int trackIndex, Animation animation, bool loop, float delay, float startTime = 0) {
...
entry.time = startTime;
This code makes it work! kinda
Something isn't quite right, im not sure what. it misses the final key of animations? basically we fade a character in from black, and using the above code the character is darker than usual.
We do something like addfadein
queueidle
(delay of 0). Seems like the fadein didn't finish playing
08 Mar 2016, 17:55
well, there is an arithmetic error. sometimes, kinda. Reson why the fade didn't happen was infact because of the blend. but I did not expect those animations to be skipped forward. code above is incorrect, but on the right track maybe
08 Mar 2016, 18:00
TrackEntry next = current.next;
if (next != null) {
float timea = next.time;
float a = current.lastTime - next.delay;
bool b = false;
if (next.time > 0)
{
b = true;
a = current.lastTime - next.time + next.delay;
}
float c;
c = current.lastTime - next.delay;
if (c >= 0) {
if (b)
{
next.time = a; next.lastTime = a;
}
else
next.time = a;
SetCurrent(i, next);
};
} else {
This kinda works. but im unsure if I have broken events.
08 Mar 2016, 18:09
events work fine, its just the a = current.lastTime - next.time + next.delay;
which is incorrect (again I set the next.time) in the addanimation function