Class Visual

java.lang.Object
rea.components.Visual

public class Visual extends Object
A visual representation of a game component. It includes an image and the size in pixels to which it should be scaled.
Author:
José Paulo Leal jpleal@fc.up.pt
  • Constructor Details

    • Visual

      public Visual(String pathname, int width, int height)
      Create a visual representation of a game component.
      Parameters:
      pathname - path to image
      width - width in pixels
      height - height in pixels
  • Method Details

    • getPathname

      public String getPathname()
      The path to image to be displayed. The path is relative to {resources/META-INF/resources} directory.
      Returns:
      path to image
    • getWidth

      public int getWidth()
      The width in pixels to which the image should be scaled
      Returns:
      width in pixels
    • getHeight

      public int getHeight()
      The height in pixels to which the image should be scaled
      Returns:
      height in pixels
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object