Class ImagePerson


  • public class ImagePerson
    extends java.lang.Object
    This class holds image of hero to be painted
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.image.BufferedImage image  
      private java.awt.image.BufferedImage[] imagesOfDirection  
      private static java.util.logging.Logger LOG  
      private int subimageHeight  
      private int subimageWidth  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImagePerson​(java.lang.String name, java.awt.Rectangle[] rectangles)  
    • Method Summary

      Modifier and Type Method Description
      java.awt.image.BufferedImage[] getImagesOfDirection()  
      java.awt.image.BufferedImage resize​(java.awt.image.BufferedImage img)
      Resizes image to be properly displayed in game
      void setAllImagesOfDirection​(java.awt.Rectangle[] rectangles)
      Parses images of hero into an array
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • image

        private java.awt.image.BufferedImage image
      • imagesOfDirection

        private java.awt.image.BufferedImage[] imagesOfDirection
      • subimageWidth

        private int subimageWidth
      • subimageHeight

        private int subimageHeight
      • LOG

        private static final java.util.logging.Logger LOG
    • Constructor Detail

      • ImagePerson

        public ImagePerson​(java.lang.String name,
                           java.awt.Rectangle[] rectangles)
    • Method Detail

      • setAllImagesOfDirection

        public void setAllImagesOfDirection​(java.awt.Rectangle[] rectangles)
        Parses images of hero into an array
        Parameters:
        rectangles - is array of hero images
      • resize

        public java.awt.image.BufferedImage resize​(java.awt.image.BufferedImage img)
        Resizes image to be properly displayed in game
        Parameters:
        img - is image to be resized
        Returns:
        resized image
      • getImagesOfDirection

        public java.awt.image.BufferedImage[] getImagesOfDirection()