Android Open Source - proteus-sidescroller Sprite Accessor






From Project

Back to project page proteus-sidescroller.

License

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.

Java Source Code

package com.bartholomew.proteus.tween;
/*from  w  ww  .  j  av  a 2  s .co  m*/
import aurelienribon.tweenengine.TweenAccessor;
import com.badlogic.gdx.graphics.g2d.Sprite;

public class SpriteAccessor implements TweenAccessor<Sprite> {

  public static final int ALPHA = 0;
    
  @Override
  public int getValues(Sprite target, int tweenType, float[] returnValues) {
    switch (tweenType){
    case ALPHA:
      returnValues[0] = target.getColor().a;
      return 1;
    default:
      assert false;
      return -1; // Error if tweenType is unknown
    }
  }

  @Override
  public void setValues(Sprite target, int tweenType, float[] newValues) {
    switch (tweenType){
    case ALPHA:
      target.setColor(target.getColor().r, target.getColor().g, target.getColor().b, newValues[0]);
      break;
    default:
      assert false;
    }
  }

}




Java Source Code List

com.bartholomew.proteus.GameWorld.java
com.bartholomew.proteus.InputController.java
com.bartholomew.proteus.MainActivity.java
com.bartholomew.proteus.MainMenu.java
com.bartholomew.proteus.Main.java
com.bartholomew.proteus.Proteus.java
com.bartholomew.proteus.Splash.java
com.bartholomew.proteus.client.GwtLauncher.java
com.bartholomew.proteus.tween.ActorAccessor.java
com.bartholomew.proteus.tween.SpriteAccessor.java