SHARE
TWEET

Untitled

a guest Sep 27th, 2014 201 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.mygdx.game.handlers;
  2.  
  3. import aurelienribon.tweenengine.TweenAccessor;
  4.  
  5. import com.badlogic.gdx.graphics.g2d.Sprite;
  6.  
  7. public class SpriteAccessor implements TweenAccessor<Sprite> {
  8.  
  9.         public static final int ALPHA = 0;
  10.        
  11.         @Override
  12.         public int getValues(Sprite arg0, int arg1, float[] arg2) {
  13.                 switch(arg1) {
  14.                 case ALPHA:
  15.                         arg2[0] = arg0.getColor().a;
  16.                         return 1;
  17.                         default:
  18.                                 assert false;
  19.                                 return -1;
  20.                 }
  21.         }
  22.  
  23.         @Override
  24.         public void setValues(Sprite arg0, int arg1, float[] arg2) {
  25.                 switch(arg1) {
  26.                 case ALPHA:
  27.                         arg0.setColor(arg0.getColor().r, arg0.getColor().g, arg0.getColor().b, arg2[0]);
  28.                         break;
  29.                         default:
  30.                                 assert false;
  31.                 }
  32.         }
  33.  
  34.        
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top