public float maxHeight() { float max = -1f; for (SpriteImage s : spriteImages) { if (s.height() > max) max = s.height(); } return max; }
public Bitmap getBitmap() { SpriteImage simg = animation.getSpriteImage(); if (simg != null) { return simg.getBitmap(); } return null; }
/** 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; }
/** * @see * com.shavenpuppy.jglib.sprites.Animated#setCurrentImage(com.shavenpuppy.jglib.sprites.SpriteImage) */ public void setImage(SpriteImage image) { this.image = image; if (image == null) { return; } assert image.isCreated() : "Image " + image + " not created!"; assert image.getStyle() != null : "Image " + image + " has no style!"; }
/** Update the Sprite layer. */ private void updateLayer() { if (current != null) { layer.setImage( current .image() .subImage( current.x(), current.y(), current.width(), current.height())); } }
/** Return the height of the current sprite. */ public float height() { if (current != null) { return current.height(); } else { return 1; } }
/** Return the width of the current sprite. */ public float width() { if (current != null) { return current.width(); } else { return 1; } }