forked from Meiguro/simplyjs
-
Notifications
You must be signed in to change notification settings - Fork 227
Animations not queuing #123
Copy link
Copy link
Open
Description
Each element has its own animation queue. Animations are queued when Element.animate is called multiple times at once with the same element. The animations will occur in order, and the first animation will occur immediately.
If I call element.animate multiple times, only one animation is executed with the united values of all animations and the duration of the last animation.
var UI = require('ui');
var Vector2 = require('vector2');
var w = new UI.Window();
var rect = new UI.Rect({
position: new Vector2(0,0),
size: new Vector2(10, 10)
});
w.add(rect);
w.show();
rect.animate({ size: new Vector2(10,152), easing: 'linear' }, 2000);
rect.animate({ size: new Vector2(144,152), easing: 'linear' }, 4000);In my opinion the problem is the if-case in ui/element.js:86. When calling only element.animate multiple times the element._queue will always be empty and animate.call(this); is executed every time.
I want to ask if the error is in the documentation or my understanding of it before suggesting a solution.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels