public void setRegionWidth (int width) { if (isFlipX()) { setU(u2 + width / (float)texture.getWidth()); } else { setU2(u + width / (float)texture.getWidth()); } }
public void setRegionWidth (int width) { if (isFlipX()) { setU(u2 + width / (float)texture.getWidth()); } else { setU2(u + width / (float)texture.getWidth()); } }
public TextureRegion getFrame(float dt){ TextureRegion region; switch (currentState){ case MOVING_SHELL: case STANDING_SHELL: region = shell; break; case WALKING: default: region = walkAnimation.getKeyFrame(stateTime, true); break; } if(velocity.x > 0 && region.isFlipX() == false){ region.flip(true, false); } if(velocity.x < 0 && region.isFlipX() == true){ region.flip(true, false); } stateTime = currentState == previousState ? stateTime + dt : 0; //update previous state previousState = currentState; //return our final adjusted frame return region; }
public void setRegionWidth (int width) { if (isFlipX()) { setU(u2 + width / (float)texture.getWidth()); } else { setU2(u + width / (float)texture.getWidth()); } }