/** Return max width among all sprites */ public float maxWidth() { float max = -1f; for (SpriteImage s : spriteImages) { if (s.width() > max) max = s.width(); } return max; }
/** Return the width of the current sprite. */ public float width() { if (current != null) { return current.width(); } else { return 1; } }
/** Update the Sprite layer. */ private void updateLayer() { if (current != null) { layer.setImage( current .image() .subImage( current.x(), current.y(), current.width(), current.height())); } }