Home | History | Annotate | Download | only in tweenengine

Lines Matching refs:Timeline

8  * A Timeline can be used to create complex animations made of sequences and
27 * Timeline.createSequence()
46 public final class Timeline extends BaseTween<Timeline> {
51 private static final Pool.Callback<Timeline> poolCallback = new Pool.Callback<Timeline>() {
52 @Override public void onPool(Timeline obj) {obj.reset();}
53 @Override public void onUnPool(Timeline obj) {obj.reset();}
56 static final Pool<Timeline> pool = new Pool<Timeline>(10, poolCallback) {
57 @Override protected Timeline create() {return new Timeline();}
62 * are waiting in the Timeline pool.
80 * Creates a new timeline with a 'sequence' behavior. Its children will
83 public static Timeline createSequence() {
84 Timeline tl = pool.get();
90 * Creates a new timeline with a 'parallel' behavior. Its children will be
93 public static Timeline createParallel() {
94 Timeline tl = pool.get();
106 private Timeline current;
107 private Timeline parent;
115 private Timeline() {
139 * Adds a Tween to the current timeline.
141 * @return The current timeline, for chaining instructions.
143 public Timeline push(Tween tween) {
144 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
150 * Nests a Timeline in the current one.
152 * @return The current timeline, for chaining instructions.
154 public Timeline push(Timeline timeline) {
155 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
156 if (timeline.current != timeline) throw new RuntimeException("You forgot to call a few 'end()' statements in your pushed timeline");
157 timeline.parent = current;
158 current.children.add(timeline);
163 * Adds a pause to the timeline. The pause may be negative if you want to
167 * @return The current timeline, for chaining instructions.
169 public Timeline pushPause(float time) {
170 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
176 * Starts a nested timeline with a 'sequence' behavior. Don't forget to
177 * call {@link end()} to close this nested timeline.
179 * @return The current timeline, for chaining instructions.
181 public Timeline beginSequence() {
182 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
183 Timeline tl = pool.get();
192 * Starts a nested timeline with a 'parallel' behavior. Don't forget to
193 * call {@link end()} to close this nested timeline.
195 * @return The current timeline, for chaining instructions.
197 public Timeline beginParallel() {
198 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
199 Timeline tl = pool.get();
208 * Closes the last nested timeline.
210 * @return The current timeline, for chaining instructions.
212 public Timeline end() {
213 if (isBuilt) throw new RuntimeException("You can't push anything to a timeline once it is started");
220 * Gets a list of the timeline children. If the timeline is started, the
233 public Timeline build() {
241 if (obj.getRepeatCount() < 0) throw new RuntimeException("You can't push an object with infinite repetitions in a timeline");
262 public Timeline start() {