Lines Matching refs:Tween
8 * Core class of the Tween Engine. A Tween is basically an interpolation
10 * Tween is that you can apply an easing formula on this interpolation, in
15 * The Universal Tween Engine is called "universal" because it is able to apply
24 * new interpolations easily. The common way to create a Tween is by using one
28 * - Tween.to(...)<br/>
29 * - Tween.from(...)<br/>
30 * - Tween.set(...)<br/>
31 * - Tween.call(...)
34 * <h2>Example - firing a Tween</h2>
44 * Tween.to(myObject, POSITION_XY, 0.5f)
52 * Tween life-cycles can be automatically managed for you, thanks to the
53 * {@link TweenManager} class. If you choose to manage your tween when you start
59 * You need to periodicaly update the tween engine, in order to compute the new
79 public final class Tween extends BaseTween<Tween> {
98 Tween.combinedAttrsLimit = limit;
102 * Changes the limit of allowed waypoints for each tween. Defaults to 0 to
106 Tween.waypointsLimit = limit;
120 private static final Pool.Callback<Tween> poolCallback = new Pool.Callback<Tween>() {
121 @Override public void onPool(Tween obj) {obj.reset();}
122 @Override public void onUnPool(Tween obj) {obj.reset();}
125 private static final Pool<Tween> pool = new Pool<Tween>(20, poolCallback) {
126 @Override protected Tween create() {return new Tween();}
131 * waiting in the Tween pool.
145 // Static -- tween accessors
156 * @param defaultAccessor The accessor that will be used to tween any
193 * Tween.to(myObject, POSITION, 1.0f)
200 * the tween.
205 * @return The generated Tween.
207 public static Tween to(Object target, int tweenType, float duration) {
208 Tween tween = pool.get();
209 tween.setup(target, tweenType, duration);
210 tween.ease(Quad.INOUT);
211 tween.path(TweenPaths.catmullRom);
212 return tween;
231 * Tween.from(myObject, POSITION, 1.0f)
238 * the tween.
243 * @return The generated Tween.
245 public static Tween from(Object target, int tweenType, float duration) {
246 Tween tween = pool.get();
247 tween.setup(target, tweenType, duration);
248 tween.ease(Quad.INOUT);
249 tween.path(TweenPaths.catmullRom);
250 tween.isFrom = true;
251 return tween;
270 * Tween.set(myObject, POSITION)
277 * the tween.
281 * @return The generated Tween.
283 public static Tween set(Object target, int tweenType) {
284 Tween tween = pool.get();
285 tween.setup(target, tweenType, 0);
286 tween.ease(Quad.INOUT);
287 return tween;
301 * Tween.call(myCallback)
309 * @return The generated Tween.
312 public static Tween call(TweenCallback callback) {
313 Tween tween = pool.get();
314 tween.setup(null, -1, 0);
315 tween.setCallback(callback);
316 tween.setCallbackTriggers(TweenCallback.START);
317 return tween;
321 * Convenience method to create an empty tween. Such object is only useful
326 * @return The generated Tween.
329 public static Tween mark() {
330 Tween tween = pool.get();
331 tween.setup(null, -1, 0);
332 return tween;
366 private Tween() {
418 * Sets the easing equation of the tween. Existing equations are located in
438 * @return The current tween, for chaining instructions.
442 public Tween ease(TweenEquation easeEquation) {
448 * Forces the tween to use the TweenAccessor registered with the given
453 * @return The current tween, for chaining instructions.
455 public Tween cast(Class<?> targetClass) {
456 if (isStarted()) throw new RuntimeException("You can't cast the target of a tween once it is started");
472 * @return The current tween, for chaining instructions.
474 public Tween target(float targetValue) {
491 * @return The current tween, for chaining instructions.
493 public Tween target(float targetValue1, float targetValue2) {
512 * @return The current tween, for chaining instructions.
514 public Tween target(float targetValue1, float targetValue2, float targetValue3) {
532 * @return The current tween, for chaining instructions.
534 public Tween target(float... targetValues) {
550 * @return The current tween, for chaining instructions.
552 public Tween targetRelative(float targetValue) {
569 * @return The current tween, for chaining instructions.
571 public Tween targetRelative(float targetValue1, float targetValue2) {
590 * @return The current tween, for chaining instructions.
592 public Tween targetRelative(float targetValue1, float targetValue2, float targetValue3) {
610 * @return The current tween, for chaining instructions.
612 public Tween targetRelative(float... targetValues) {
630 * @return The current tween, for chaining instructions.
632 public Tween waypoint(float targetValue) {
651 * @return The current tween, for chaining instructions.
653 public Tween waypoint(float targetValue1, float targetValue2) {
674 * @return The current tween, for chaining instructions.
676 public Tween waypoint(float targetValue1, float targetValue2, float targetValue3) {
696 * @return The current tween, for chaining instructions.
698 public Tween waypoint(float... targetValues) {
711 * @return The current tween, for chaining instructions.
715 public Tween path(TweenPath path) {
732 * Gets the type of the tween.
781 public Tween build() {
910 + "attributes in a tween. You can raise this limit with "
911 + "Tween.setCombinedAttributesLimit(), which should be called once "
918 + "waypoints to a tween. You can raise this limit with "
919 + "Tween.setWaypointsLimit(), which should be called once in "