Back to project page proteus-sidescroller.
The source code is released under:
GNU General Public License
If you think the Android project proteus-sidescroller listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bartholomew.proteus.tween; //from w ww .j a va 2 s . c o m import com.badlogic.gdx.scenes.scene2d.Actor; import aurelienribon.tweenengine.TweenAccessor; public class ActorAccessor implements TweenAccessor<Actor> { public static final int Y = 0, RGB = 1, ALPHA = 2; @Override public int getValues(Actor target, int tweenType, float[] returnValues) { switch (tweenType){ case Y: returnValues[0] = target.getY(); case RGB: returnValues[0] = target.getColor().r; returnValues[1] = target.getColor().g; returnValues[2] = target.getColor().b; return 1; case ALPHA: returnValues[0] = target.getColor().a; return 1; default: return -1; // Error, unknown tweenType } } @Override public void setValues(Actor target, int tweenType, float[] newValues) { switch (tweenType){ case Y: target.setY(newValues[0]); break; case RGB: target.setColor(newValues[0], newValues[1], newValues[2], target.getColor().a); break; case ALPHA: target.setColor(target.getColor().r, target.getColor().g, target.getColor().b, newValues[0]); break; default: assert false; } } }