Beispiel #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;
 }
Beispiel #2
0
 /** Return the width of the current sprite. */
 public float width() {
   if (current != null) {
     return current.width();
   } else {
     return 1;
   }
 }
Beispiel #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()));
   }
 }