Example #1
0
 /** 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;
 }
Example #2
0
 /** Return the width of the current sprite. */
 public float width() {
   if (current != null) {
     return current.width();
   } else {
     return 1;
   }
 }
Example #3
0
 /** Update the Sprite layer. */
 private void updateLayer() {
   if (current != null) {
     layer.setImage(
         current
             .image()
             .subImage(
                 current.x(), current.y(),
                 current.width(), current.height()));
   }
 }